Creating word doc in Outlook

C

chuck rudolph

I am trying to write a macro in outlook to print just the body of the
message. My macro looks like:

Set oWordApp = CreateObject("Word.Application")
If oWordApp Is Nothing Then
MsgBox "Couldn't start Word."
Else
Dim oWordDoc
Dim bolPrintBackground

Dim x, y As String
'I have to believe its one of these...
x = Outlook.ActiveInspector.CurrentItem.Body
y = Outlook.ActiveInspector.CurrentItem.HTMLBody
'Create the new work doc
Set oDoc = oWordApp.Documents.Add()
'the next line will work for just the text.
oDoc.Range.Text = x

But what do I use for a body that has some HTML formatting in it?
I tried oDoc.Range.InsertXML(x or y) and got a "can't insert xml data here"

Thanks for the help...Chuck
 
W

Word Heretic

G'day "chuck rudolph" <[email protected]>,

Oh boy. Word 2003 has a whole bunch of new node commands to add xml to
a file opened as xml. My preference is usually to open the file as
text and use ye olde Fine Replace and Insert text methods.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


chuck rudolph reckoned:
 

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