Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP/Outlook problems
Message
From
11/10/2002 10:25:26
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
VFP/Outlook problems
Miscellaneous
Thread ID:
00710311
Message ID:
00710311
Views:
58
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
Next
Reply
Map
View

Click here to load this message in the networking platform