Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I remove horizontal line that was inserted by auto format? | Microsoft Word Help | |||
how do I format a header field | Microsoft Word Help | |||
Help to merge Image (Doug Robins?) | Mailmerge | |||
Page x of y problems | Microsoft Word Help | |||
How do I insert and format part of a data field in a Word document | Microsoft Word Help |