Reference to figures are not in same font as body of document

  • Thread starter Thread starter Barb Reinhardt
  • Start date Start date
B

Barb Reinhardt

I have a document with figures and the references to the figures within the
body of the document are in 12 point font. The remainder of the body of the
document is in 11 point font. Where do I change the default font for these
references so that when they are updated, they remain at 11 point font.
 
I have a document with figures and the references to the figures within the
body of the document are in 12 point font. The remainder of the body of the
document is in 11 point font. Where do I change the default font for these
references so that when they are updated, they remain at 11 point font.

Hi Barb,

Toggle the field code of the reference (press Shift+F9 or click Toggle
Field Code on the right-click menu) and add
\* charformat
just before the closing brace. If there's a \* mergeformat there,
remove it. Then update the field (press F9 or click Update Field on
the right-click menu).

This will make the field result formatting the same as the formatting
of the letter R in the REF keyword inside the field code, regardless
of the formatting of the source.
 
Hi Barb,

Use this macro (see http://www.gmayor.com/installing_macro.htm for
installation instructions):

Public Sub CrossRefFormat()
Dim oFld As Field
Dim strCode As String

For Each oFld In ActiveDocument.Fields
With oFld
If .Type = wdFieldRef Then
' grab the field code
strCode = .Code.Text

' if the code contains MERGEFORMAT,
' change it to CHARFORMAT
strCode = Replace(strCode, _
"MERGEFORMAT", "CHARFORMAT")
strCode = Replace(strCode, _
"mergeformat", "CHARFORMAT")

' if the code didn't contain a format,
' insert CHARFORMAT
If InStr(strCode, "CHARFORMAT") = 0 Then
strCode = strCode & " \* CHARFORMAT"
End If

' put in the new field code
.Code.Text = strCode

' update the field to new result
.Update
End If
End With
Next oFld
End Sub
 
Back
Top