General information
Category:
COM/DCOM and OLE Automation
Title:
Accessing email addresses in Outlook
I need a little help with Outlook automation.
I want to rerieve all the email addresses in one of the contact lists of our Outlook Address Book.
I have been studying Outlook in the VFP8 Object Browser and experimenting in the command window. Here is what I have been able to come up with so far:
oOutlook = CreateObject("Outlook.Application")
oNameSpace = oOutlook.GetNameSpace("MAPI")
? onamespace.AddressLists.Session.AddressLists.Count
The third line above displays a 2 which is the number of contact lists we have.
? onamespace.AddressLists(1).Name
? onamespace.AddressLists(2).Name
The two lines above display 'Contacts' and 'LMC Address Book' which are the names of our two contact lists.
? onamespace.AddressLists(1).AddressEntries.Count
? onamespace.AddressLists(2).AddressEntries.Count
The two lines above display 14 and 82 respectively which are the correct number of entries in each of the two contact lists.
? onamespace.AddressLists(1).AddressEntries[1].Name
? onamespace.AddressLists(2).AddressEntries[1].Name
The two lines above will display the name of the first person in each contact list in the format: 'LastName, FirstName'.
Here is my question. How can I access the email address (and other information) of the names in these contact lists? I have not been able to find the field names for this information in the VFP8 object browser. What a I missing?
Thanks very much.
Stan
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only