how to format a cross reference?

G

Guest

I would like all cross references that I insert (Insert>Reference>Cross
Reference)
to appear in a blue font. It doesn't help that my hyperlink style is already
formatted. how? (Word 2003)
 
G

Guest

You could create a _character_ style that applies blue font. You will then
have to apply that character style to all your cross-references.

Tip: before inserting a cross-reference, select your special character
style. Insert the cross-reference. Then press Ctrl+Spacebar to return to the
underlying paragraph style before you continue typing.

For information about styles, see:
http://www.shaunakelly.com/word/styles/TipsOnStyles.html

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 
S

Suzanne S. Barnhill

Word suppresses the Hyperlink character style formatting on some hyperlinks
that it inserts, including cross-references and TOC entries. You can apply
this formatting manually, perhaps as a different character style, but you
can't achieve it through the Hyperlink style (which Word will very likely
reapply when you update the REF fields).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Guest

What I wanted to do was to AUTOMATICALLY have xrefs be colored blue when I
insert one.
 
G

Guest

You need a macro to apply the blue color automatically. The macro must be
named "InsertCrossReference" in order to run instead of the built-in command
whenever you select Insert > Reference > Cross-reference. The macro below
should do what you want. It applies the same blue color as used for
hyperlinks (wdColorBlue). See the comments in the code for an explanation of
what happens.

Sub InsertCrossReference()

Dim oRange As Range
Dim oColor_Old As WdColor

Set oRange = Selection.Range
'Save current font color
oColor_Old = oRange.Characters(1).Font.Color
'Diaplay cross-reference dialog box
Dialogs(wdDialogInsertCrossReference).Show
'Include the inserted cross-reference in oRange
oRange.End = Selection.End
'Apply blue color to oRange
oRange.Font.Color = wdColorBlue
'Reset color after cross-reference
Selection.Font.Color = oColor_Old

Set oRange = Nothing

End Sub

For information about installing macros, see:
http://www.gmayor.com/installing_macro.htm

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 
G

Guest

Thank-you!

This, together with another fix (communicated by mail) really solves my
problem.
(You told me to replace the line:

Dialogs(wdDialogInsertCrossReference).Show

with the following lines:

With Dialogs(wdDialogInsertCrossReference)
.InsertAsHyperLink = True
.Show
End With

...in order to ensure that the "Insert as Hyperlink" check box is always
selected.)
 

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