populate word template from Outlook custom form

  • Thread starter Thread starter Joel Allen
  • Start date Start date
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
 
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:
 
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
 
Back
Top