FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for CA-Clipper Export to outlook contacts
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Export to outlook contacts
Posted: Tue Apr 10, 2007 03:37 PM

Hello,

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

Thanks
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Export to outlook contacts
Posted: Tue Apr 10, 2007 05:25 PM
#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
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Export to outlook contacts
Posted: Wed Apr 11, 2007 05: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

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Export to outlook contacts
Posted: Wed Apr 11, 2007 06:59 AM
#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

Continue the discussion