![]() |
|
#5
|
||||
|
||||
|
How about we identify the fields in a different way and use the Character style that makes it italic.
Code:
Sub SetFieldFormat()
Dim aFld As Field, sCode As String
For Each aFld In ActiveDocument.Fields
sCode = LCase(aFld.Code)
If sCode Like "* ref *" Then
Debug.Print sCode
If aFld.Result.Words.First.Previous = "(" Then
Debug.Print aFld.Result.Words.First.Previous
If sCode Like "*mergeformat*" Then
sCode = Replace(sCode, "mergefield", "charfield")
ElseIf Not sCode Like "*charformat*" Then
sCode = sCode & " \* charformat "
aFld.Code.Text = sCode
End If
aFld.Result.Style = "Emphasis"
aFld.Update
End If
End If
Next aFld
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Extract numbers from parentheses and add them up | pokeyarw | Excel | 9 | 05-06-2019 09:50 PM |
| add parentheses to a letter | steve8778 | Word | 6 | 11-17-2016 07:50 AM |
Allignment of numbers with parentheses
|
RussBell | Mail Merge | 2 | 10-28-2016 05:51 AM |
Parentheses Changing on Document
|
Subject1157 | Word | 2 | 06-16-2011 08:46 PM |
| Problem With Formatting Mailmerge Fields | revans611 | Mail Merge | 0 | 05-31-2009 06:20 PM |