Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question on class MAPIMAIL
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00704577
Message ID:
00704616
Views:
18
Hi Samuel:

This is what I use to get address from Outlook Contacts:

#DEFINE Contacts 10

WAIT WINDOW 'Building Address List...' NOWAIT NOCLEAR

LOCAL oNameSpace, oContacts

oOutlook = CREATEOBJECT('Outlook.Application')
oNameSpace = oOutlook.GetNameSpace('MAPI')
oContacts = oNameSpace.GetDefaultFolder(Contacts)

CREATE CURSOR ContactInfo ;
(address C(100), fname C(20), lname C(40))

FOR EACH oContact IN oContacts.Items
cAddr = oContact.Email1Address
cFname = oContact.FirstName
cLname = oContact.LastName
INSERT INTO ContactInfo (address, fname, lname) VALUES (cAddr, cFname, cLname)
ENDFOR

SELECT ContactInfo
SCAN
THISFORM.lstSelect.ADDITEM(ContactInfo.address)
ENDSCAN

RELEASE oOutlook
RELEASE oNamesSpace
RELEASE oContacts

THIS.REFRESH()
WAIT CLEAR
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform