How to copy RTF into another application?

J

John Riddle

Hello,

I have a macro that parses a Word Document (a resume) and creates an Outlook
contact out of it. I then copy and paste the entire contents of the document
to the Notes field in Outlook. A manual copy/paste of a Word document's
contents into the Notes field in Outlook preserves the RTF formatting.
However, when I do this programmatically, it appears as plain text in the
Notes field in Outlook. Here is the code that I'm using:

oContact.Body = ActiveDocument.Range.Text

Is there a different way to paste (in RTF format) all of the text of a Word
Document into the Notes (Body) field of Outlook Contact Item?

John
 
D

Doug Robbins - Word MVP

Try

oContact.Body = ActiveDocument.Range.FormattedText


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

John Riddle

Doug,

Thanks for your prompt response. However, that still didn't work. Still
looses all formatting. I mean the paragraphs and such are correct, but the
font, bold, italics, size, etc. are all lost.

Any other suggestions?

Thanks,

John
 
R

Russ

See below.
Doug,

Thanks for your prompt response. However, that still didn't work. Still
looses all formatting. I mean the paragraphs and such are correct, but the
font, bold, italics, size, etc. are all lost.

Any other suggestions?

Thanks,

John

Did you try using the clipboard with VBA's .copy and .paste methods?
 
R

Russ

Another idea...
Does the notes field of Outlook allow for the insertion of a file like a
Word document allows for a insertion of a file? And it looks like a AutoText
entry can use the .insert method to preserve formatting. I normally use
Entourage on a Mac, so I can't test Outlook at home.
 
R

Russ

Even more obvious, I suppose. Have you tried posting the question in an
Outlook newsgroup, who should be more familiar with the limitations of
Outlook Notes.
 
R

Russ

I also see that there is a .pastespecial method which can paste from the
clipboard as rtf.
Maybe there is a way to add a note by actually pointing to and opening up a
Word document as the body of the note.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top