Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Importing contact in Outlook 6 addressbook
Message
From
09/09/2003 03:25:50
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Importing contact in Outlook 6 addressbook
Miscellaneous
Thread ID:
00827390
Message ID:
00827390
Views:
46
Hello,

I have the following code to add a new contact in MS Outlook 2000 addressbook on a machine with Windows XP Home edition. And it works good. But, it doesn't work on a Windows 98 machine with MS Outlook version 6.
Does anybody know why?



#DEFINE olContactItem 2
#DEFINE olBusiness 2

LOCAL oNameSpace, oContact
IF VarType(oOutlook) <> "0"
RELEASE oOutlook
PUBLIC oOutlook
oOutlook = CREATEOBJECT("Outlook.Application")
ENDIF

** De tabel openen
CLOSE DATABASES ALL
SELECT 0
USE tabel2

GO TOP
DO WHILE NOT EOF()
oNameSpace = oOutlook.GetNameSpace("MAPI")
oContact = oOutlook.CreateItem( olContactItem )
WITH oContact
.FullName = naam
.CompanyName = bedrijf
.BusinessAddressStreet = adres
.BusinessAddressCity = plaats
.BusinessAddressState = provincie
.BusinessAddressPostalCode = postcode
.BusinessAddressCountry = land
.SelectedMailingAddress = olBusiness
.BusinessTelephoneNumber = tel
.BusinessFaxNumber = fax
.Email1Address = email
.Save()
ENDWITH
SKIP
ENDDO

MESSAGEBOX('Address is added to MS Outlook.')
CLOSE DATABASES ALL

Thanks in advance
Ron.
Next
Reply
Map
View

Click here to load this message in the networking platform