Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
Dispaying emails in Outlook
I am creating emails in VFP using code similar to that below...
* ----------------------------------------
oOutlook = CREATEOBJECT('outlook.application')
SELECT MyCursor
SCAN
oitem = oOutlook.CreateItem(0)
WITH oItem
.Recipients.Add('blinedata@aol.com')
.subject = "Test message "
.HTMLBody = lcMyHTMLString
.Save()
ENDWITH
ENDSCAN
* -----------------------------------------
Once the program has run I can manually activate Outlook and look at the emails and send them when I am ready, but...
a) The emails are being placed in the 'Drafts' folder in Outlook by default, how can I programatically send them to the Outbox folder instead?
b) Instead of having to click on Outlook in the button-bar to bring it forward, how can this be done programmatically? Using oItem.display I can see each individual message as it is created, but I do not want to interrupt the loop - I want to see all the messages once the SCAN/ENDSCAN loop has finished. Automating MS Word has something like oWord.show, is there an equivalent command for Outlook? Also, when the Outlook window is displayed, how can I programatically select the required folder?
Any help would be appreciated.
Alan Harris-Reid
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