Information générale
Catégorie:
COM/DCOM et OLE Automation
* test001.prg
*
#define olContactItem 2
#define olBusiness 2
I am just beginning looking into automating Outlook. I have the GRANOR/MARTIN book which explains this. On page 340 there is a fairly simple example of adding a contact to outlook which I have attempted to mimic (see below).
I runs smoothly but the contact does not show up in Outlook. Any ideas as to why ?
Local oNameSpace, oContact
if varType(oOutlook) <> "O"
wait "Creating Outlook Object Variable ... " window timeout 2
Release oOutlook
public oOutlook
oOutlook = createObject("Outlook.Application")
endif
cNameSpace = oOutlook.GetNameSpace("MAPI")
oContact = oOutlook.CreateItem(olContactItem)
with oContact
.FullName = "Shaina Dascher"
.PrimaryTelephoneNumber = "570-494-0664"
.Save() && Note: I know it goes thru this spot by using the debugger.
endwith
oOutlook.quit()
return
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement