Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
 
Posts: n/a
Default Format field inserted with VBA

I'm new to VBA in word, but I assume this should be easy. I'm using VBA
to set up a mailmerge and insert certain fields. How do I edit the code
to apply formatting to some of the fields? For example, in the lines
below, I would like the JournalDate field to be in italics.

Thank you.

###

With MainDoc.Fields

.Add Word.Selection.Range, Word.WdFieldType.wdFieldMergeField,
"AuthorList", False
'Selection.TypeText " "
.Add Word.Selection.Range, Word.WdFieldType.wdFieldMergeField,
"JournalDate", False
'Selection.TypeText " "

etc.

###

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod
 
Posts: n/a
Default Format field inserted with VBA

You'll need to either format the whole field, or insert a \* Charformat
switch then format the first character of the field (ie the 'M' in
'MAILMERGE'). Either way, you'll have to apply the italics after inserting
the field.

Cheers


wrote in message
ups.com...
I'm new to VBA in word, but I assume this should be easy. I'm using VBA
to set up a mailmerge and insert certain fields. How do I edit the code
to apply formatting to some of the fields? For example, in the lines
below, I would like the JournalDate field to be in italics.

Thank you.

###

With MainDoc.Fields

.Add Word.Selection.Range, Word.WdFieldType.wdFieldMergeField,
"AuthorList", False
'Selection.TypeText " "
.Add Word.Selection.Range, Word.WdFieldType.wdFieldMergeField,
"JournalDate", False
'Selection.TypeText " "

etc.

###



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I remove horizontal line that was inserted by auto format? Susan35802 Microsoft Word Help 6 September 2nd 08 09:59 PM
how do I format a header field L Temp Microsoft Word Help 3 June 29th 05 08:26 AM
Help to merge Image (Doug Robins?) JohnB Mailmerge 21 June 23rd 05 05:28 PM
Page x of y problems Cowtoon Microsoft Word Help 7 March 15th 05 04:28 PM
How do I insert and format part of a data field in a Word document Graham Blundell Microsoft Word Help 4 December 1st 04 02:51 PM


All times are GMT +1. The time now is 03:55 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"