cross reference appearance in text

N

Nicky

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
 
S

Stefan Blom

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

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top