Switch for underlining a cross reference

J

jerem

Can anyone tell me how I can get a cross reference to come in underlined - I
thought the switch was a u but that doesn't seem to work.

Thanks for your help.
 
M

macropod

Hi jerem,

If you're doing this via a cross-reference (REF) field, you can underline the 'R' in 'REF', then add a '\* Charformat' switch to the
field.

Cheers
 
J

jerem

Sorry this reply comes so late - I've tried that and it works only for the
cross reference that I alter with underlining the R in Ref and adding \*
Charformat, however, when I put in successive cross references they come in
without the underlining. Any remedy to this or, any way of searching using
Find and ^d for finding a field code, however, being able to designate to
only find Cross Reference fields?

macropod said:
Hi jerem,

If you're doing this via a cross-reference (REF) field, you can underline the 'R' in 'REF', then add a '\* Charformat' switch to the
field.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

jerem said:
Can anyone tell me how I can get a cross reference to come in underlined - I
thought the switch was a u but that doesn't seem to work.

Thanks for your help.
 
M

macropod

Hi jerem,

You need to do this for each cross-reference. Of course, if you've got multiple cross-references to the same bookmark, you could
simply copy & paste the altered instance. Other than that, you could automate the REF field editing via vba.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

jerem said:
Sorry this reply comes so late - I've tried that and it works only for the
cross reference that I alter with underlining the R in Ref and adding \*
Charformat, however, when I put in successive cross references they come in
without the underlining. Any remedy to this or, any way of searching using
Find and ^d for finding a field code, however, being able to designate to
only find Cross Reference fields?

macropod said:
Hi jerem,

If you're doing this via a cross-reference (REF) field, you can underline the 'R' in 'REF', then add a '\* Charformat' switch to
the
field.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

jerem said:
Can anyone tell me how I can get a cross reference to come in underlined - I
thought the switch was a u but that doesn't seem to work.

Thanks for your help.
 
R

Russ

Jerem,
A consequence of using this suggested formatting code is that the formatting
will also be there when printing the document.

Public Sub UnderlineAllRefs()

Dim aField As Word.Field
Dim lngPlaceholder As Long

For Each aField In ActiveDocument.Fields
If aField.Type = wdFieldRef Then
If InStr(aField.Code.Text, "Charformat") = 0 Then
aField.Code.Text = aField.Code.Text & "\* Charformat"
End If
lngPlaceholder = InStr(aField.Code.Text, "REF")
aField.Code.Characters(lngPlaceholder).Font.Underline = True
aField.Code.Characters(lngPlaceholder).Font.Color = wdColorBlue
aField.Update
End If
Next aField

End Sub
Hi jerem,

You need to do this for each cross-reference. Of course, if you've got
multiple cross-references to the same bookmark, you could
simply copy & paste the altered instance. Other than that, you could automate
the REF field editing via vba.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

jerem said:
Sorry this reply comes so late - I've tried that and it works only for the
cross reference that I alter with underlining the R in Ref and adding \*
Charformat, however, when I put in successive cross references they come in
without the underlining. Any remedy to this or, any way of searching using
Find and ^d for finding a field code, however, being able to designate to
only find Cross Reference fields?

macropod said:
Hi jerem,

If you're doing this via a cross-reference (REF) field, you can underline
the 'R' in 'REF', then add a '\* Charformat' switch to
the
field.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Can anyone tell me how I can get a cross reference to come in underlined -
I
thought the switch was a u but that doesn't seem to work.

Thanks for your help.
 
R

Russ

Jerem,
You may have to combine my macro code with the suggested code at this
webpage for finding crossreferences in headers and footers.
http://word.mvps.org/faqs/customization/ReplaceAnywhere.htm
Jerem,
A consequence of using this suggested formatting code is that the formatting
will also be there when printing the document.

Public Sub UnderlineAllRefs()

Dim aField As Word.Field
Dim lngPlaceholder As Long

For Each aField In ActiveDocument.Fields
If aField.Type = wdFieldRef Then
If InStr(aField.Code.Text, "Charformat") = 0 Then
aField.Code.Text = aField.Code.Text & "\* Charformat"
End If
lngPlaceholder = InStr(aField.Code.Text, "REF")
aField.Code.Characters(lngPlaceholder).Font.Underline = True
aField.Code.Characters(lngPlaceholder).Font.Color = wdColorBlue
aField.Update
End If
Next aField

End Sub
Hi jerem,

You need to do this for each cross-reference. Of course, if you've got
multiple cross-references to the same bookmark, you could
simply copy & paste the altered instance. Other than that, you could automate
the REF field editing via vba.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

jerem said:
Sorry this reply comes so late - I've tried that and it works only for the
cross reference that I alter with underlining the R in Ref and adding \*
Charformat, however, when I put in successive cross references they come in
without the underlining. Any remedy to this or, any way of searching using
Find and ^d for finding a field code, however, being able to designate to
only find Cross Reference fields?

:

Hi jerem,

If you're doing this via a cross-reference (REF) field, you can underline
the 'R' in 'REF', then add a '\* Charformat' switch to
the
field.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Can anyone tell me how I can get a cross reference to come in underlined -
I
thought the switch was a u but that doesn't seem to work.

Thanks for your help.
 

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