Hi
I have a document that includes both cross-references and hyperlinks that
allow users to click and be taken to other parts of the document. I'd like to
change the appearance of the cross-references in the text so they have the
same formatting features as hyperlinks (font color andunlderline), so it's
obvious to users that the relevant text is linked. But when I select the
cross references fields and apply the hyperlinks style to the selected text,
the appearance doesn't change.
Any thoughts on why this is, and how I can get around it?
Nicky
Stefan Blom - 30 Apr 2007 12:22 GMT
Have you tried applying direct formatting (or a custom character style)
instead? Note that any formatting added will be lost when fields are
updated, unless you actually format the field code and add the \
*CHARFORMAT switch to it. This macro will do exactly that for REF and
PAGEREF fields:
Sub FormatRefFields()
Dim f As Field
For Each f In ActiveDocument.Fields
If f.Type = wdFieldRef Or f.Type = wdFieldPageref Then
f.Code.Font.Color = wdColorBlue
f.Code.Font.Underline = wdUnderlineSingle
If InStr(UCase$(f.Code.Text), "\* CHARFORMAT") = 0 Then
f.Code.Text = f.Code.Text & "\* CHARFORMAT"
End If
f.Update
End If
Next f
End Sub

Signature
Stefan Blom
Microsoft Word MVP
> Hi
> I have a document that includes both cross-references and hyperlinks that
[quoted text clipped - 8 lines]
>
> Nicky