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. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,540
    Thanks
    3
    Thanked 148 Times in 141 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

  3. #3
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,947
    Thanks
    0
    Thanked 204 Times in 185 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]

  4. #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
  •