N
Namgaw
How can I can capture (replicate programatically) the act of copying
the body of a Word document to an Outlook message?
Thanks.
the body of a Word document to an Outlook message?
Thanks.
Those are 2 different things. Which do you want to do, trap when a copy from
Word is made to an Outlook item body, or copy text from Word to an Outlook
item body using code?
- Show quoted text -
See if it works any better if you just get the entire contents of the Word
doc as a string and set Body to that.
<snip>
- Show quoted text -
Then I think the only way to do what you want would be to work in HTML and
set the text from Word into HTMLBody using the HTML tags and HTML code and
parsing.
<snip>
- Show quoted text -
Copy a portion that includes all the formats you want to include from one of
the docs you want to save into a new document and save it as HTML, then open
the htm file using Notepad. That's what the Word HTML looks like. It's badly
formed and horribly verbose but that's what you'll have to deal with.
Then save a blank HTML email message as an HTM file and open that in
Notepad. It will look something like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16544" name=GENERATOR></HEAD>
<BODY>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV></BODY></HTML>
The <BODY> </BODY> tags are where you have to place your Word text. You'll
have to remove duplicate definitions and place the Word text where you want
it. There are some simple HTML formatting samples for Outlook atwww.outlookcode.com, but if you want to do anything fancy looking you'll
have to do some research on HTML coding to get things the way you want.
You're essentially merging two different HTML sources with non-compatible
formatting.
Things would be easier if you had Word 2003 to go along with Outlook 2003.
Then you could use WordMail and at least the HTML source would be more
compatible although uglier on the WordMail part.
<snip>
- Show quoted text -