Copy rtf message body 
Author Message
 Copy rtf message body

I have searched through Microsoft's documentation with no results so far.

Does anyone know how I can copy the message body of an existing e-mail WITH
all its formatting. The original message is in rich text format. When I copy
the message body over (newmail.body = oldmail.body), the bold formatting
seems to get lost.

Thanks in advance.

Sanjay



Tue, 03 Aug 2004 04:46:47 GMT  
 Copy rtf message body
See http://www.slipstick.com/dev/formatmsg.htm

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool


Quote:
> I have searched through Microsoft's documentation with no results so far.

> Does anyone know how I can copy the message body of an existing e-mail WITH
> all its formatting. The original message is in rich text format. When I copy
> the message body over (newmail.body = oldmail.body), the bold formatting
> seems to get lost.

> Thanks in advance.

> Sanjay



Tue, 03 Aug 2004 06:18:56 GMT  
 Copy rtf message body
To work with the formatted body of an RTF message, you need to use CDO with a special DLL or Redemption. See http://www.slipstick.com/dev/formatmsg.htm

--
Sue Mosher, Outlook MVP
   Outlook and Exchange Solutions
   at http://www.slipstick.com

Quote:

> I have searched through Microsoft's documentation with no results so far.

> Does anyone know how I can copy the message body of an existing e-mail WITH
> all its formatting. The original message is in rich text format. When I copy
> the message body over (newmail.body = oldmail.body), the bold formatting
> seems to get lost.

> Thanks in advance.

> Sanjay



Tue, 03 Aug 2004 06:05:20 GMT  
 Copy rtf message body

Quote:

> To work with the formatted body of an RTF message, you need to use CDO

with a special DLL or Redemption.

Actually, to *copy* an existing RTF message body you don't need any
additional DLL. It is just a single MAPI property which can be copied with
CDO 1.21. Used this in an Exchange 5.5 Event Script I wrote back in 2000.
Try something like that:

Const CdoPR_RTF_COMPRESSED = &H10090102
objSession.Logon

' Get a message from the inbox
Set objCurrentMsg = objSession.Inbox.Messages.Item(1)

' Get the fields of the current message
Set objFields = objCurrentMsg.Fields
Set objField = objFields.Item(CdoPR_RTF_COMPRESSED)

' Create a new message
Set objNewMsg = objSession.Inbox.Messages.Add

' This line adds the RTF body to the new message
objNewMsg.Fields.Add(CdoPR_RTF_COMPRESSED), objField.Value

--
<Siegfried />

Microsoft Most Valuable Professional (MVP) - Exchange Server
Co-author of "Professional CDO Programming", Wrox Press 1999

CDOLive - The Premier Resource for Microsoft Messaging and Collaboration
Application Technology
http://www.cdolive.com

Please reply to the newsgroups so that others can benefit from the
discussion.
Questions by e-mail are discarded without further notice.



Wed, 04 Aug 2004 08:56:29 GMT  
 Copy rtf message body
THanks! I should remember that, since I used to use it. <g>

--
Sue Mosher, Outlook MVP
   Outlook and Exchange Solutions
   at http://www.slipstick.com


Quote:

> > To work with the formatted body of an RTF message, you need to use CDO
> with a special DLL or Redemption.

> Actually, to *copy* an existing RTF message body you don't need any
> additional DLL. It is just a single MAPI property which can be copied with
> CDO 1.21. Used this in an Exchange 5.5 Event Script I wrote back in 2000.
> Try something like that:

> Const CdoPR_RTF_COMPRESSED = &H10090102
> objSession.Logon

> ' Get a message from the inbox
> Set objCurrentMsg = objSession.Inbox.Messages.Item(1)

> ' Get the fields of the current message
> Set objFields = objCurrentMsg.Fields
> Set objField = objFields.Item(CdoPR_RTF_COMPRESSED)

> ' Create a new message
> Set objNewMsg = objSession.Inbox.Messages.Add

> ' This line adds the RTF body to the new message
> objNewMsg.Fields.Add(CdoPR_RTF_COMPRESSED), objField.Value

> --
> <Siegfried />

> Microsoft Most Valuable Professional (MVP) - Exchange Server
> Co-author of "Professional CDO Programming", Wrox Press 1999

> CDOLive - The Premier Resource for Microsoft Messaging and Collaboration
> Application Technology
> http://www.cdolive.com

> Please reply to the newsgroups so that others can benefit from the
> discussion.
> Questions by e-mail are discarded without further notice.



Sat, 07 Aug 2004 00:39:33 GMT  
 
 [ 5 post ] 

 Relevant Pages 

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

2. RTF message body from OOM?

3. Put formatted (.rtf) text in message body from Access

4. RTF message body from ItemSend?

5. placing rtf in the message body

6. Copying rtf messages

7. Copy Message from RTF Document

8. Retrieving message body text of currently selected message

9. Rich Text File (.RTF) -Can't copy multiple .rtf files

10. Rich Text File (.RTF) -Can't copy multiple .rtf files (VB 6.0 Enterprise)

11. Need help with RTF in body of an Outlook XP e-mail

12. Pasting excel range into outlooks body (rtf)

 

 
Powered by phpBB® Forum Software