Copy/Paste from Word to Outlook 2003

  • Thread starter Jesslyn Hendrix
  • Start date
J

Jesslyn Hendrix

I have an Outlook form and need to copy the contents of a Word document with
it's variables into the htmlbody of the form. How would I do that? When
cutting and pasting manually, it works fine, when I use the below code, I
get all the text, but it is unformatted and I need the bold, underlines,
etc.

the code to paste into the body of the email
gettext= replace(gettext, "!Pops", wrdFileText)
omail.htmlbody = gettext

the code that copies from word
objWord.Selection.WholeStory
objWord.Selection.Fields.Update
'objWord.Selection.copy
wrdFileText = objword.selection.text
 
S

Sue Mosher [MVP-Outlook]

One approach is to save the Word document as an .htm file, then use the
file's contents to set HTMLBody.

Are you using Word as your email editor? If so, you can use
Inspector.WordEditor.
 
J

Jesslyn Hendrix

I see from your response that I did not explain the problem thoroughly.

The body of the form that I want to paste into is an already formatted blank
form with co. logo, banners, etc. So I have to place my text into the exact
particular spot. THat is what I was trying to accomplish with the replace
function. So when that did not work, I tried to paste, thinking that the
items in the clipboard would come over already formatted. I am starting to
think that I am doing this all backwards.
 
S

Sue Mosher [MVP-Outlook]

You still haven't answered the key question that will determine what methods
are available to you -- are you using Word as your email editor?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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