Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2007

Tip: Looking for answers? Try searching our database.

cross reference appearance in text

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nicky - 30 Apr 2007 10:12 GMT
Hi
I have a document that includes both cross-references and hyperlinks that
allow users to click and be taken to other parts of the document. I'd like to
change the appearance of the cross-references in the text so they have the
same formatting features as hyperlinks (font color andunlderline), so it's
obvious to users that the relevant text is linked. But when I select the
cross references fields and apply the hyperlinks style to the selected text,
the appearance doesn't change.

Any thoughts on why this is, and how I can get around it?

Nicky
Stefan Blom - 30 Apr 2007 12:22 GMT
Have you tried applying direct formatting (or a custom character style)
instead? Note that any formatting added will be lost when fields are
updated, unless you actually format the field code and add the \
*CHARFORMAT switch to it. This macro will do exactly that for REF and
PAGEREF fields:

Sub FormatRefFields()
Dim f As Field
For Each f In ActiveDocument.Fields
   If f.Type = wdFieldRef Or f.Type = wdFieldPageref Then
       f.Code.Font.Color = wdColorBlue
       f.Code.Font.Underline = wdUnderlineSingle
       If InStr(UCase$(f.Code.Text), "\* CHARFORMAT") = 0 Then
           f.Code.Text = f.Code.Text & "\* CHARFORMAT"
       End If
       f.Update
   End If
Next f
End Sub

Signature

Stefan Blom
Microsoft Word MVP

> Hi
> I have a document that includes both cross-references and hyperlinks that
[quoted text clipped - 8 lines]
>
> Nicky

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.