D
Dave
Hello All,
I have a very long document with a lot of cross references. I am using the
following macro to change the colour of my cross references to Blue.
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
With Dialogs(wdDialogInsertCrossReference)
..InsertAsHyperLink = True
..Show
End With
'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
I got it from one of the other newsgroups,it works fine as long as I don't
update my fields. The moment I update the filed the formatting reverts back
to the normal para formatting. So how do I maintain the formatting even
after I update the field.
Thanks in advance
Dave
I have a very long document with a lot of cross references. I am using the
following macro to change the colour of my cross references to Blue.
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
With Dialogs(wdDialogInsertCrossReference)
..InsertAsHyperLink = True
..Show
End With
'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
I got it from one of the other newsgroups,it works fine as long as I don't
update my fields. The moment I update the filed the formatting reverts back
to the normal para formatting. So how do I maintain the formatting even
after I update the field.
Thanks in advance
Dave