General information
Category:
COM/DCOM and OLE Automation
Title:
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only