Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Montreal, Quebec
    Posts
    125
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi gang,
    I want to select all cross-reference fields in a document and apply a formatting to them.
    I cannot seem to be able to Find a cross-reference field in a document using the Find feature.
    I always get the message that there are none in the document (I know there are some).
    I can GoTo a cross-reference field without problem.
    I want to be able to Find all occurence of a cross-reference field and apply bold or italic to them.
    Anything I am missing?
    Johanne Champagne
    Montreal (Quebec) CANADA

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,514
    Thanks
    3
    Thanked 143 Times in 136 Posts
    There is a trick to doing this, you need to show the field codes in your document first. Do this by selecting all and pressing Shift-F9
    Next in the Find box type ^d Ref
    Apply the Italic or bold to the Replace with box but leave it empty
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #3
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,894
    Thanks
    0
    Thanked 188 Times in 172 Posts
    Instead of selecting all then pressing Shift-F9, you could simply press Alt-F9.

    Also, you'll need to delete any MERGEFORMAT switches that appear in the cross-reference fields and, ideally, add a CHARFORMAT switch to them. Here's a macro to automate the process, bolding and italicizing all cross-references.
    Code:
    Sub HiliteRefs()
    Dim oFld As Field
    For Each oFld In ActiveDocument.Fields
      With oFld
        If .Type = wdFieldRef Then
          With .Code
          .Font.Bold = True
          .Font.Italic = True
          .Text = Trim(Replace(Replace(.Text, "\* mergeformat", "", , , vbTextCompare), _
            "\* charformat", "", , , vbTextCompare)) & " \* CHARFORMAT"
          End With
          .Update
        End If
      End With
    Next
    End Sub
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  5. #4
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Montreal, Quebec
    Posts
    125
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK. Will try that.
    Tks.
    Johanne Champagne
    Montreal (Quebec) CANADA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •