View Single Post
  #5   Report Post  
Posted to microsoft.public.word.formatting.longdocs
Doug Robbins - Word MVP
 
Posts: n/a
Default cross-references and hyperlinks

The following code should check to see if the \h (hyperlink) switch has been
added to the Ref field

Dim aref As Field
For Each aref In ActiveDocument.Fields
If aref.Type = wdFieldRef Then
If InStr(aref.Code, "\h") 0 Then
With aref.result.Font
.Color = wdColorBlue
.Underline = wdUnderlineSingle
End With
End If
End If
Next aref


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Jose Durazo" wrote in message
...
Doug, thanks for the help. I hadn't thought of a macro-based solution for
this, but this helped me save a lot of time.

For the benefit of others who want to use this solution, the check "If
aref.Type = wdFieldRef" is not quite right. When I remove this check, all
of my cross-references are correctly changed but some extra fields that
aren't really hyperlinks are turned to blue underlined text. I still have
to figure out which specific field types to check for, but I know I'm on
the right track now.

Thanks again!
Jose