How do I search for cross references?

D

Dan Smith

I'm trying to find where an autonumber is used as a cross reference i.e.

[17] some text
....
See Ref [17]

Where the second [17] is a cross reference to the first displaying the text.
I cannot 'Find' [17] in the document (not even the original autonumber).
Ideally I'd like something like Excel's 'Show Dependants' option to show
where an item is referred to. But I'd settle for just being able to search
the document without having to save it as a .txt file first.
 
P

Peter T. Daniels

The "Go To" panel (Ctrl-G, or click the page number indicator in the
Status Bar) will take you to cross references -- have it search for
"Any Field."

In order to find cross references (or any kind of field) using "Find,"
you need to display the field codes: For cross references, Ctrl-A,
Shift-F9. (For other fields, such as index markers, Show Non-Printing
Characters, Ctrl-Shift-S, will do it.)
 
G

Graham Mayor

You can probably find what you need with a macro. The following will check
each field to see whether it is a cross reference to a numbered item and
stop for further instruction.


Sub FindCrossRef()
Dim oField As Field
For i = 1 To ActiveDocument.Fields.Count
Set oField = ActiveDocument.Fields(i)
oField.Select
If oField.Type = wdFieldRef Then
If InStr(oField.Code, "REF _Ref") Then
sText = MsgBox("The current field is a reference to " & _
oField.Result & vbCr & _
"Continue to the next match?", vbYesNo)
If sText = vbNo Then
Exit Sub
End If
End If
End If
Next i
End Sub
http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Suzanne S. Barnhill

Select the numbered text, go to Insert | Bookmark, check the box for "Hidden
bookmarks" and select the radio button for "Location." Note the bookmark
that is highlighted. It will be in the form _Ref123456789.

Now display field codes (Alt+F9) and use Find to search for the text of the
bookmark (i.e., _Ref123456789 or whatever), which will be in a REF field
somewhere.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 

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