populate word template from Outlook custom form

Status
Not open for further replies.
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
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
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

Am Tue, 16 Feb 2010 13:52:09 -0800 schrieb 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
 
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

"Michael Bauer " <mb@mvps.org> wrote in message

news:1m3rcda2dxu5l$.1tkoggf7ch3c3$.dlg@40tude.net...

> 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
>

>

> Am Tue, 16 Feb 2010 13:52:09 -0800 schrieb 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
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
S populate body with Word data Outlook VBA and Custom Forms 7
C Custom Outlook Form - Populate Information from Radio Button / Check Box Using Outlook 0
C Trying to populate an appointment ComboBox from Excel Outlook VBA and Custom Forms 2
A Populate Listbox from Txt File Outlook VBA and Custom Forms 0
A Populate Textbox from Txt File Outlook VBA and Custom Forms 1
M Adding Macro to populate "to" "subject" "body" not deleting email string below. Outlook VBA and Custom Forms 5
Diane Poremsky Outlook VBA: Use a Text File to Populate a ListBox New Slipstick.com Articles 0
T populate calendar with appointments and send reminders Using Outlook 1
A Populate Excel from Outlook Userform Outlook VBA and Custom Forms 3
J Live Meeting Location populate from body Outlook VBA and Custom Forms 4
A How can I populate a dropdown list? BCM (Business Contact Manager) 4
rohit I want to Populate Popup box while sending any email with attachment. Outlook VBA and Custom Forms 4
rohit I want to Populate Popup box while sending any email with attachment Using Outlook 1
A Cannot populate IMAP folders Using Outlook 1
S Pre populate subject + body + attachment to already open email in outlook 2007 Using Outlook 2
S Populate textbox values from one form to another form. Using Outlook 0
B Auto Populate From Field Using Outlook 3
J calendar: populate multiple appointment subject fields at once Using Outlook 4
D Reply to a sender does not populate the To: Field Using Outlook 1
K Quickest way to populate email via IMAP up to a server. Using Outlook 1
M Exchange and IMAP Accounts: Populate Exchange Calendar with IMAP Meeting Requests Using Outlook 1
L Can't populate History of Business Contacts- receive 1st error: cannon load an object because it is not available, then 2nd: Cannot display this view Using Outlook 1
A Uploaded Outlook Contacts Will Not Populate Email Address Using Outlook 2
9 BCM 2010 populate created/due field for created Direct Mail Print Using Outlook 4
C Outlook address book won't populate Using Outlook 2
I Get right account to populate on new e-mail (2010) Using Outlook 1
N Activities Tab does not populate with all linked activity Using Outlook 3
G Populate an Outlook 2007 template with spreadsheet data. Outlook VBA and Custom Forms 1
R Populate Form with appointments from Calendar Outlook VBA and Custom Forms 1
G Populate BCC field with all Contacts within a Contact Folder Outlook VBA and Custom Forms 4
M Create new Contacts folder and populate it from Access Outlook VBA and Custom Forms 1
A Macro - Open new message, populate from and subject fields, and message text Outlook VBA and Custom Forms 1
G Macro: Create New Message and Auto populate To Field Outlook VBA and Custom Forms 5
L how to populate multiple users contacts Outlook VBA and Custom Forms 9
A Populate task field based on value of other field Outlook VBA and Custom Forms 9
C blocking two or more word domains separated by period/dot Using Outlook 4
P Outlook 2013 Word Share doc as Email Attachment now brings up Eudora. Using Outlook 1
Jennifer Murphy Ctrl+Tab sometimes will not move through text a word at a time Using Outlook 1
N How to remove signature formatting from Text in Word (accidentally taken from Outlook) Using Outlook 0
C replace subject line generated by converting a word document to PDF and sending it to an email Using Outlook 8
Diane Poremsky Use Word Macro to Apply Formatting to Email New Slipstick.com Articles 0
iwshim word shortcut to search outlook Using Outlook 3
C Outlook 2016 - converting Word VBA to default Outlook message Outlook VBA and Custom Forms 0
C Merging Word and Access into Outlook Using Outlook 4
Q Why can't I copy image with embedded hyperlink from email to Word Using Outlook 0
Mark Foley Emailing attachment from Word/Excel sends attachment but no message body Using Outlook 0
Diane Poremsky Disable Live Preview in Outlook and Word New Slipstick.com Articles 0
Philip Rose Recreating a WORD Editing Macro to use in Outlook VBA Outlook VBA and Custom Forms 4
D Need to extract a line from a word attachment, and add it to the subject line Outlook VBA and Custom Forms 3
M Unable to email from Word or Excel Using Outlook 11
Similar threads


















































Top