Export to outlook contacts

Export to outlook contacts

Postby Marc Vanzegbroeck » Tue Apr 10, 2007 3:37 pm

Hello,

Is there a posibility to export the email-adresses that are now in a FW-database to outlook contacts?

Thanks
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Export to outlook contacts

Postby Enrico Maria Giordano » Tue Apr 10, 2007 5:25 pm

Code: Select all  Expand view
#define olContactItem 2


FUNCTION MAIN()

    LOCAL oOutlook := CREATEOBJECT( "Outlook.Application" )

    LOCAL oContact := oOutlook:CreateItem( olContactItem )

    oContact:FullName = "This is a new contact"
    oContact:Email1Address = "newcontact@newmail.it"

    oContact:Save()

    oOutlook:Quit()

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Marc Vanzegbroeck » Wed Apr 11, 2007 5:12 am

Thanks Enrico,

Is there also a possibility to check if a contact already exist? My customer is adding contacts in my program and want to update every month the contacts in outlook.

Thanks,
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Postby Enrico Maria Giordano » Wed Apr 11, 2007 6:59 am

Code: Select all  Expand view
#define olFolderContacts 10


FUNCTION MAIN()

    LOCAL oOutlook := CREATEOBJECT( "Outlook.Application" )
    LOCAL oNameSpace := oOutlook:GetNameSpace("MAPI")
    LOCAL oContacts := oNameSpace:GetDefaultFolder( olFolderContacts )

    LOCAL i

    FOR i = 1 TO oContacts:Items:Count
        IF oContacts:Items[ i ]:FullName = "MyContact"
            ? "Found!"
            EXIT
        ENDIF
    NEXT

    oOutlook:Quit()

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 14 guests