getting the AddressEntry object to update for a Personal Address Book

P

peteshaw

[getting the AddressEntry object to update for a Personal Address Book]

What I am trying to do is a write a vbscript that will, on userl login,
update any Personal Address Books they may have with the updated entry
in the Global Address List. Currently, I am developing this in VB6 and
I'll port it over to vbscript when I'm done.

The script looks something like


oMAPI.Logon
Set colAddressLists = oMAPI.AddressLists
Set colGALAddressEntries = colAddressLists("Global Address
List").AddressEntries

For Each objAddressList In colAddressLists
if objAddressEntry.type = Case OlDisplayType.olUser
Set objGALAddress =
colGALAddressEntries.Item(objAddressEntry.Name)
objAddressEntry.Type = objGALAddress.Type
objAddressEntry.Address = objGALAddress.Address
objAddressEntry.Update True, True
End If
Next objAddressList

The problem is, that this only updates the address in the PAB if it
happens to be an SMTP type. There doesn't seem to be any visible
properties that allow you to set the property to X.400, SMTP, etc..,
and I don't know how to force the entry to get updated.

Any ideas? I'm really stuck on this, and i know the answer lies in my
poor grasp of the MAPI object model. I should add that I am tryingn to
run this on a machine with Outlook 2003 installed, but I will have to
factor it for Outlook 2000. Any help will be most sincerely
apprecieated, so thankt in advance.

regards
--Peter j. Shaw
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top