Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
VFP/Outlook problems
I am using OLE automation with VFP and Outlook to create emails from VFP data using something like the code below...
* -----------------------------
lcHTMLString = my message formatted as html
lcHTMLString = lcHTMLString+ HTML body tag code
* can't show directly here as tags would be interperated as html!
oOutlook = CREATOBJECT('Outlook.application')
oItem = oOutlook.createitem(0) && create new mail message
WITH oItem
.recipients.add(emailaddress)
.subject = MySubject"
.HTMLBody = lcHTMLString
.save()
.send()
ENDWITH
* -----------------------------
If I select to send the emails immediately they are generated, the received emails look fine, but if I try to view the sent version (ie. the message stored in the 'out-tray'), the body of the email is blank! Is this because I have used the .HTMLBody property instead of .body?
I originally did use oItem.body to store the message, and that worked fine, until I needed to line-up some data halfway through the message and use a non-proportional font. Placing and in the text string did not work - it output literally, that's why I resorted to an HTML string solution.
a) If I use the .HTMLBody property, how can I view the emails before transmission?
b) If I use the .body property, how can I embed HTML formatting tags?
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