Body property of Message in Outlook Object Model 
Author Message
 Body property of Message in Outlook Object Model

Quote:

> Hi all,

> I'm creating a new outlook email programmatically using VB. How can I
> assign RTF (Rich Text Format) or contents of a word document to the
> body of the message? I tried the Body property of the Message object
> but it's of type string and hence only takes strings. Any
> suggestions???    

You can't assign RTF text but you can assign HTML to the HTMLBody property.

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US



Sat, 07 May 2005 07:54:28 GMT  
 Body property of Message in Outlook Object Model
Thanks for the reply Michael. I do realize that. However, I convert word/RTF
documents to HTML on the server and then send the HTML back to the client as
the message body. By doing that I loose all the images since they stay on
the server and just the HTML gets sent back to the client (to the HTMLBody
property).



Quote:

> > Hi all,

> > I'm creating a new outlook email programmatically using VB. How can I
> > assign RTF (Rich Text Format) or contents of a word document to the
> > body of the message? I tried the Body property of the Message object
> > but it's of type string and hence only takes strings. Any
> > suggestions???

> You can't assign RTF text but you can assign HTML to the HTMLBody
property.

> --
> Michael Harris
> Microsoft.MVP.Scripting
> Seattle WA US



Sat, 07 May 2005 08:09:10 GMT  
 Body property of Message in Outlook Object Model

Quote:

> Thanks for the reply Michael. I do realize that. However, I convert
> word/RTF documents to HTML on the server and then send the HTML back
> to the client as the message body. By doing that I loose all the
> images since they stay on the server and just the HTML gets sent back
> to the client (to the HTMLBody property).

There was a thread in the ...outlook.program_vba or
...office.developer.outlook.vba newgroup within the last month or so on how
to embed and reference images in html mail.

Sue Mosher (Outlook MVP) has an example at
http://www.slipstick.com/dev/code/htmlimg.htm.

It requires the use of CDO...

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US



Sat, 07 May 2005 08:47:01 GMT  
 Body property of Message in Outlook Object Model

Hi all,

I'm creating a new outlook email programmatically using VB. How can I assign RTF (Rich Text Format) or contents of a word document to the body of the message? I tried the Body property of the Message object but it's of type string and hence only takes strings. Any suggestions???

Thanks in advance.



Sat, 07 May 2005 07:07:09 GMT  
 Body property of Message in Outlook Object Model
When word converts a DOC to HTM, is there a way to for word not to create
that directory instead embed the images into the HTM file?



Quote:

> > Thanks for the reply Michael. I do realize that. However, I convert
> > word/RTF documents to HTML on the server and then send the HTML back
> > to the client as the message body. By doing that I loose all the
> > images since they stay on the server and just the HTML gets sent back
> > to the client (to the HTMLBody property).

> There was a thread in the ...outlook.program_vba or
> ...office.developer.outlook.vba newgroup within the last month or so on
how
> to embed and reference images in html mail.

> Sue Mosher (Outlook MVP) has an example at
> http://www.slipstick.com/dev/code/htmlimg.htm.

> It requires the use of CDO...

> --
> Michael Harris
> Microsoft.MVP.Scripting
> Seattle WA US



Sat, 07 May 2005 09:28:47 GMT  
 Body property of Message in Outlook Object Model
Quote:

> When word converts a DOC to HTM, is there a way to for word not to
> create that directory instead embed the images into the HTM file?

I don't know, but I doubt it...

You might want to ask in ...word.vba.general or
...office.developer.automation.

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US



Sat, 07 May 2005 10:02:23 GMT  
 Body property of Message in Outlook Object Model
Thats a nice article, thank. However, my process is a little bit more
complicated. I'm converting word docs to html on the server and the server
doesn't know anything about the User outlook setting or CDO. It just open up
a word document, do something in it, converts it to HTML, read the HTML into
a variable sends it to a client script on a user's machine. The client
script creates an Outlook message using whatever came from the server as the
body of the message. Now in that process I just get the HTML sent back to
the client but the images stay in the server in some Doc1_files directory in
windows temp directory that gets created when Ms Word converts the doc to
htm.



Quote:

> > Thanks for the reply Michael. I do realize that. However, I convert
> > word/RTF documents to HTML on the server and then send the HTML back
> > to the client as the message body. By doing that I loose all the
> > images since they stay on the server and just the HTML gets sent back
> > to the client (to the HTMLBody property).

> There was a thread in the ...outlook.program_vba or
> ...office.developer.outlook.vba newgroup within the last month or so on
how
> to embed and reference images in html mail.

> Sue Mosher (Outlook MVP) has an example at
> http://www.slipstick.com/dev/code/htmlimg.htm.

> It requires the use of CDO...

> --
> Michael Harris
> Microsoft.MVP.Scripting
> Seattle WA US



Sat, 07 May 2005 09:12:36 GMT  
 Body property of Message in Outlook Object Model

Quote:


>> When word converts a DOC to HTM, is there a way to for word not to
>> create that directory instead embed the images into the HTM file?

> I don't know, but I doubt it...

> You might want to ask in ...word.vba.general or
> ...office.developer.automation.

Michael,
Do you think there is any way for a .MHT file to be created and sent?

-Paul Randall



Mon, 09 May 2005 00:43:48 GMT  
 Body property of Message in Outlook Object Model
Thanks for the idea Paul. I'm able to save the document as MHT file but how
can I use it to create an outlook message?


Quote:


> >> When word converts a DOC to HTM, is there a way to for word not to
> >> create that directory instead embed the images into the HTM file?

> > I don't know, but I doubt it...

> > You might want to ask in ...word.vba.general or
> > ...office.developer.automation.

> Michael,
> Do you think there is any way for a .MHT file to be created and sent?

> -Paul Randall



Mon, 09 May 2005 07:52:00 GMT  
 Body property of Message in Outlook Object Model
Quote:

> Thanks for the idea Paul. I'm able to save the document as MHT file
> but how can I use it to create an outlook message?

Hi,
I don't know anything about the Outlook Object Model.  I was just hoping that it can handle .MHTs as easily as it handles HTML.
Maybe some expert can figure a way.

-Paul Randall



Mon, 09 May 2005 09:47:07 GMT  
 Body property of Message in Outlook Object Model

Quote:

> Thanks for the idea Paul. I'm able to save the document as MHT file
> but how can I use it to create an outlook message?

I don't think you can.  If you create an MHT file and open it in a text
editor, it does look basically like HTML.  To get the effect of just
assigning it as the HTMLBody of a message, I changed the extension to HTM
and opened it directly in IE to see what would happen - not pretty ;-)...

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US



Mon, 09 May 2005 22:39:02 GMT  
 Body property of Message in Outlook Object Model
Well, Thanks for your comments guys. My only other alternative then would be
to find C++ code to get to RTFBody propert using Extended MAPI (which I was
trying to avoid)  :)



Quote:

> > Thanks for the idea Paul. I'm able to save the document as MHT file
> > but how can I use it to create an outlook message?

> I don't think you can.  If you create an MHT file and open it in a text
> editor, it does look basically like HTML.  To get the effect of just
> assigning it as the HTMLBody of a message, I changed the extension to HTM
> and opened it directly in IE to see what would happen - not pretty ;-)...

> --
> Michael Harris
> Microsoft.MVP.Scripting
> Seattle WA US



Tue, 10 May 2005 02:56:55 GMT  
 Body property of Message in Outlook Object Model
Outlook Redemption (www.dimastr.com) lets you access a property called
RTFBody inside a MailItem.

Look in there for instructions.

--
{*filter*}JIT

Hi all,

I'm creating a new outlook email programmatically using VB. How can I assign
RTF (Rich Text Format) or contents of a word document to the body of the
message? I tried the Body property of the Message object but it's of type
string and hence only takes strings. Any suggestions???

Thanks in advance.



Wed, 14 Sep 2005 17:11:43 GMT  
 
 [ 13 post ] 

 Relevant Pages 

1. Body property of Message in Outlook Object Model

2. Body property of Message in Outlook Object Model

3. Save message in rtf-Format with Outlook Object Model

4. using outlook 97 object model with outlook 95?

5. Outlook Object Model in Access + Outlook View Control

6. Outlook Object Model... Need Version of Outlook

7. Sending HTML In Body of Outlook Message using VBSCRIPT (WSCRIPT)

8. Report Object Model/Viewer Object Model

9. (*.RTF) as message body to Outlook, Possible???

10. Replacing message body text in Outlook 2000 7 XP

11. Outlook Automation - SaveAs creates message with empty body

12. find/replace in outlook message body

 

 
Powered by phpBB® Forum Software