View Single Post
  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Lene Fredborg Lene Fredborg is offline
external usenet poster
 
Posts: 1,291
Default how to format a cross reference?

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


"Shari from Karkur" wrote:

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

"Lene Fredborg" wrote:

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/styl...sOnStyles.html

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


"Shari from Karkur" wrote:

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