Export to outlook contacts

Post Reply
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Export to outlook contacts

Post by Marc Vanzegbroeck »

Hello,

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

Thanks
Marc
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Export to outlook contacts

Post by Enrico Maria Giordano »

Code: Select all

#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
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Post by Marc Vanzegbroeck »

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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

Code: Select all

#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
Post Reply