View Single Post
  #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.

###