Page 1 of 1

Has anyone done this ?

PostPosted: Wed Mar 27, 2019 9:11 pm
by TimStone
My application maintains a client list with names, phone numbers, emails, etc. Of course it is stand alone.

While talking to a customer today, I wondered about sharing that client info into a contacts list ( iPhone ). Since we can do email through Outlook, I began thinking maybe we could share our Clients to Outlook also, and in doing that, it could share those contacts with our phones ( or any device running Outlook ).

Has anyone played with this ? Any thoughts ? I'd be happy to work on incorporating this ( and sharing the code ), but thought maybe someone has info that would help.

Loving the possibility.

Re: Has anyone done this ?

PostPosted: Wed Mar 27, 2019 9:44 pm
by Silvio.Falconi
Code: Select all  Expand view
#include "fivewin.ch"
#define olFolderContacts 10

ANNOUNCE RDDSYS

FUNCTION MAIN( cNomeFile )

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

LOCAL i
LOCAL aStruct := {}
AADD( aStruct , { "NOME" , "C" , 50 , 0 } )
AADD( aStruct , { "INDI" , "C" , 50 , 0 } )
AADD( aStruct , { "CAP" , "C" , 5 , 0 } )
AADD( aStruct , { "CITTA" , "C" , 50 , 0 } )
AADD( aStruct , { "STATO" , "C" , 50 , 0 } )
AADD( aStruct , { "STATO2" , "C" , 50 , 0 } )
AADD( aStruct , { "TELEFONO" , "C" , 50 , 0 } )
AADD( aStruct , { "EMAIL" , "C" , 50 , 0 } )
AADD( aStruct , { "NOTE" , "M" , 10 , 0 } )

DbCreate( cNomeFile , aStruct, "DBFCDX" )


SET DATE BRITISH
USE &cNomeFIle

FOR i = 1 TO oContacts:Items:Count
APPEND BLANK
REPLACE field->nome WITH oContacts:Items[ i ]:FullName
REPLACE field->indi WITH oContacts:Items[ i ]:BusinessAddressStreet
REPLACE field->cap WITH oContacts:Items[ i ]:BusinessAddressPostalCode
REPLACE field->citta WITH oContacts:Items[ i ]:BusinessAddressCity
REPLACE field->stato WITH oContacts:Items[ i ]:BusinessAddressState
REPLACE field->stato2 WITH oContacts:Items[ i ]:BusinessAddressCountry
REPLACE field->telefono WITH oContacts:Items[ i ]:BusinessTelephoneNumber
REPLACE field->email WITH oContacts:Items[ i ]:Email1Address
REPLACE field->note WITH oContacts:Items[ i ]:Body

NEXT

oOutlook:Quit()

RETURN NIL


INIT PROCEDURE RddInit
REQUEST DBFFPT
REQUEST DBFCDX


but I not try it ...it's a Marco Boschi source code

Re: Has anyone done this ?

PostPosted: Wed Mar 27, 2019 10:57 pm
by TimStone
Thanks ... that imports contacts into a database. I actually want to go the other way and feed customers in my system to contacts ... but that gives me a start.

Does anyone have a link to explanations on using MAPI with Outlook ( fields, etc ).

Re: Has anyone done this ?

PostPosted: Fri Apr 05, 2019 3:45 pm
by James Bott
Tim,

Try a Google search for "mapi outlook"