populate word template from Outlook custom form

J

Joel Allen

Outlook 2003 SP3

Hi,

I have a script that populates a Word template with Item.Body. The
following DOES work:

Set objSel = objDoc.Windows(1).Selection
Set objTable = objDoc.Tables(1)
objDoc.Bookmarks("Body").Range.InsertBefore Item.Body

The problem is that it doesn't keep the formatting. So I tried to do this
and it DOES NOT work. What am I missing?

Set objSel = objDoc.Windows(1).Selection
Set objTable = objDoc.Tables(1)
objSel.Copy Item.Body
objSel.PasteAndFormat (wdPasteDefault)


Thank you very much for your help,
Joel
 
M

Michael Bauer [MVP - Outlook]

If you use Word as email editor in Outlook, you could try to pass
Item.Getinspector.WordEditor (which returns a Word.Document) to objDoc.

Else this workaround could also work: Save the html email as a file, and
open that file with Word.

--
Best regards
Michael Bauer - MVP Outlook
Manage and share your categories:
<http://www.vboffice.net/product.html?pub=6&lang=en>


Am Tue, 16 Feb 2010 13:52:09 -0800 schrieb Joel Allen:
 
J

Joel Allen

I'm sorry Michael, I'm still kind of lost. Can you point me to some more
sample code that might help me?

Thank you again,
Joel
 

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