Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing email addresses in Outlook
Message
From
01/11/2004 12:04:49
Stan Vaninger
Mitek Industries, Inc
Missouri, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Accessing email addresses in Outlook
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows NT
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00956609
Message ID:
00956609
Views:
74
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
Map
View

Click here to load this message in the networking platform