Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mass emailing
Message
From
07/12/2001 13:34:29
 
 
To
07/12/2001 11:19:30
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00589809
Message ID:
00591316
Views:
32
>>>Okay, I've pretty much figured out how to automate Outlook. The only part I'm getting stuck on is how to get HTML into the body of my message, without sending an attachment. Any ideas?
>>
>>Elyse --
>>
>>HTML is simply text formatted with tags. You can generate that in VFP in a variety of fashions -- simple string concatenation is a quick and dirty method.
>>
>>I posted a procedure which creates an HTML table from a VFP cursor in message #567894. That may give you some ideas for some simple uses -- like letters. HTML is really pretty straightforward for things like formatted email.
>>
>>
>>
>>Jay
>
>Let's say I have a Word document. How can I get that to be the body of my email message? Or what if I have an HTML document? If I copy and paste from my Word doc to my Outlook message manually it works, but how can I do that programmatically?

Well, that's the $64 question isn't it?

Automating Word is the first step.

oMyWord = CREATEOBJECT ("Word.Application")

Once you have Word available as a VFP object, you can manipulate it's many methods and procedures thru VFP. I suspect there's info in the library here to give you more detail. And, Tamar Granor's and Della Martin's Microsoft Office Automation with Visual FoxPro is a great resource.

I'll go through the steps you'd need and provide suggestions for how to transform that into code. And, I hope that will give the tools you need.

The steps you want to go through for the process would look something like this:

1. Open a Word document in Word.
2. Assuming you're using Word 2000 or above (actually, 97 may work OK), select, from the menu "File..Save As.." then save to HTML format.
3. Through VFP, do a FileToStr (myWordDoc.HTM) and then you have it!

For steps 1 and 2, you can do the following:

Create a macro
Do an operation
Review the macro code -- which is in VBA.
It's a fairly straightforward conversion to VFP, but if you run into problems, post again.

HTH,
Jay
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform