Looks like I forgot to paste in the code for dealing with the Exhibit and
Appendix.
Here it is:
Dim FindText As Variant, i As Long
FindText = Split("Exhibit/Appendix", "/")
For i = 0 To UBound(FindText)
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:=FindText(i), Forward:=True, _
MatchWildcards:=False, Wrap:=wdFindStop, MatchCase:=False) =
True
With Selection
.Font.Italic = True
.Collapse wdCollapseEnd
.MoveRight wdCharacter, 1
End With
Loop
End With
Next i
The reason that you are getting the errors on the other code is because in
the code that you posted, there is the word Then missing from the end of the
first line and the word True from the end of the second line. I am not sure
where they went to as they are included in the code at the bottom of this
message.
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
Janet A. Thompson said:
Doug,
I put this in my normal.dotx in 2007 but it shows 2 read lines in the
center"V" where I've put xxx's. How to fix? THANK YOU ALL.
' ChangetoItalic Macro
'
Dim afield As Field, i As Long
With ActiveDocument
For Each afield In .Fields
If afield.Type = wdFieldRef Then
With afield.Code
If InStr(.Text, "_Ref") > 0 Then
.Text = .Text & " \* charformat"
For i = 1 To .Characters.Count
xxx If UCase(.Characters(i)) = "R"
xxx .Characters(i).Font.Italic =
Exit For
End If
Next i
End If
End With
End If
Next afield
.Range.Fields.Update
End With V"