Fields? What sort of fields? Is the surrounding text OK? If it is, the
following macro may fix it. Run the macro on the opened template and choose
the option to add the charformat switch then save it with a new name.
Sub ChangeSwitch()
Dim oRng As Range
Dim iFld As Integer
Dim strChoice As String
strChoice = MsgBox("Replace Mergeformat switch with Charformat switch?" _
& vbCr & "Click 'No' to remove formatting switch completely", _
vbYesNoCancel, "Replace Formatting Switch")
If strChoice = vbCancel Then GoTo UserCancelled
If strChoice = vbNo Then
For iFld = ActiveDocument.Fields.Count To 1 Step -1
With ActiveDocument.Fields(iFld)
If .Type <> wdFieldFormCheckBox And _
.Type <> wdFieldFormDropDown And _
.Type <> wdFieldFormTextInput Then
.Code.Text = Replace(.Code.Text, " \* MERGEFORMAT", "")
.Code.Text = Replace(.Code.Text, " \* CHARFORMAT", "")
End If
End With
Next iFld
End If
If strChoice = vbYes Then
For iFld = ActiveDocument.Fields.Count To 1 Step -1
With ActiveDocument.Fields(iFld)
If .Type <> wdFieldFormCheckBox And _
.Type <> wdFieldFormDropDown And _
.Type <> wdFieldFormTextInput Then
If InStr(1, .Code, "MERGEFORMAT") <> 0 Then
.Code.Text = Replace(.Code.Text, "MERGE", "CHAR")
End If
If InStr(1, .Code, "CHARFORMAT") = 0 Then
.Code.Text = .Code.Text & "\* CHARFORMAT "
End If
.Update
End If
End With
Next iFld
End If
Exit Sub
UserCancelled:
MsgBox "User Cancelled", vbInformation, "Replace Formatting Switch"
End Sub
http://www.gmayor.com/installing_macro.htm
Could you send me one of the errant templates in Word 2003 and 2007 formats
so that I can see where the problem lies and investigate a solution to fix
it?
Use the link on the home page of my web site.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>