Update Outlook Contacts on a Different Computer Using VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

The following snippet of VBA code running in MS Access connects me to Outlook and allows me to update items in the Outlook contact folder from Access.

Dim App As Outlook.Application
Dim Namespace As Outlook.Namespace
Dim Contacts As Outlook.MAPIFolder
Dim Item As Outlook.ContactItem

Set App = CreateObject("Outlook.Application")
Set Namespace = App.GetNamespace("MAPI")
Set Contacts = Namespace.GetDefaultFolder(olFolderContacts)
Set Item = Namespace.GetItemFromID( ... )

I would like to be able to update contact items on a different computer, a workstation on our peer-to-peer LAN. This means that I have to be able to establish a connection to the Outlook .pst file on that computer and update it from the computer where the Access code is ruinning.

Is there a way to do this? Thanks.
 
NameSpace.AddStore(FilePath As String).

Of course the PST file cannot be opened by anyone else at that time since
PST files are not multiuser. In addition, if you lose the network connection
while the PST file is opened it will be corrupted and locked. That's why MS
does not support use of PST files over a network.




Michael Ryle said:
Hi All,

The following snippet of VBA code running in MS Access connects me to
Outlook and allows me to update items in the Outlook contact folder from
Access.
Dim App As Outlook.Application
Dim Namespace As Outlook.Namespace
Dim Contacts As Outlook.MAPIFolder
Dim Item As Outlook.ContactItem

Set App = CreateObject("Outlook.Application")
Set Namespace = App.GetNamespace("MAPI")
Set Contacts = Namespace.GetDefaultFolder(olFolderContacts)
Set Item = Namespace.GetItemFromID( ... )

I would like to be able to update contact items on a different computer, a
workstation on our peer-to-peer LAN. This means that I have to be able to
establish a connection to the Outlook .pst file on that computer and update
it from the computer where the Access code is ruinning.
 
I'd like to do something like this in reverse. My company
maintains an accurate Outlook file for contacts, phones,
and e-mail. I would like to be able to search that file
from an Access application and pull phone numbers in as
required.
 
Once you have opened a PST file for that data you can access any of the
items in any of the folders by using the Outlook object model. Look in the
Object Browser on the Outlook library to see what properties are available
for every type of item and look at www.outlookcode.com for information about
programming with Outlook.
 
Back
Top