Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mass emailing
Message
From
10/12/2001 12:48:11
 
 
To
10/12/2001 12:34:19
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:
00592221
Views:
36
>>>>>>>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
>>>
>>>I created a simple document in Word with a logo and short message. I saved this file as a Web Page (html). In my code that builds the Outlook email, I set the text of my email = FileToStr(MyWordDoc.htm). But when I look at the email the program created, I see the HTML code, not my logo. Am I missing something?
>>
>>Do you see HTML only?
>>
>>Is your logo a graphic file or strictly HTML?
>>
>> Jay
>
>I see HTML only. The logo was a BMP saved as HTML.

Oh, my mistake. I thought you'd said earlier you were just trying to generate HTML from a text Word document and were not going to display graphics.

As was mentioned earlier, HTML doesn't "embed" graphics. HTML is a text only protocol. If you include a graphic in an HTML file, you'll find, in the HTML source, tags which refer to the directory path and file name of the graphic file. In your Word generated HTML document, you'll find an < IMG > tag (search on IMG as Word stuffs other stuff in the tag).

If you want to display the graphic file, any browser or email program opening the HTML document must be able to reference the graphic file by the directory information located in the tag which references that file.

There are other ways of handling graphics in HTML, but since you're using Word as an HTML editor, I'm not sure which would best suit your purposes.

Best wishes!

Jay
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform