Update the contacts in Microsoft Outlook

Update the contacts in Microsoft Outlook

Postby Marco Turco » Wed Jun 15, 2011 5:32 pm

Hi all,
I need to export my customers data into the contacts folder in Outlook. As I know it can be made via OLE.
Do you have a working sample to make this ?

Thanks in advance.
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Re: Update the contacts in Microsoft Outlook

Postby anserkk » Thu Jun 16, 2011 5:48 am

Try This,

Code: Select all  Expand view
#include "fivewin.ch"
#DEFINE olFolderContacts 10

//----------------------------------------------------------------------------//
Function Main()

    LOCAL oOutlook,oNameSpace,oDefaultFolder,oContact
    oOutlook:= CREATEOBJECT('outlook.application')
    oNameSpace:= oOutlook:getnamespace('MAPI')
    oDefaultFolder:=oNameSpace:GetDefaultFolder(olFolderContacts) // Contacts
   
    oContact = oOutlook:CreateItem(2) // oContactItem

    With object oContact
        :FirstName = "Anser First Name"
        :LastName = "Anser Last Name"
        :Email1Address = "anserkk@xdsss.com"
        :CompanyName = "My Test Company"
        :BusinessTelephoneNumber = "9689987890000"
        :BusinessFaxNumber = "123456789"
        :HomeTelephoneNumber = "987654321"
    End
   
    oContact:Close(0) // Save
    oDefaultFolder:display()
   
Return nil


Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 112 guests