General information
Category:
COM/DCOM and OLE Automation
Title:
Importing contact in Outlook 6 addressbook
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
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