highlight all fields in Word

Discussion in 'Software' started by Raenty, May 17, 2017.

  1. Raenty

    Raenty

    Joined:
    May 17, 2017
    Messages:
    1
    Likes Received:
    1
    Hi,

    I want to highlight all the fields in my word document so that I can easily find them and edit them.

    Now I can only use Ctrl+A to select all and I will see that all fields have shading. But if I click in the document ,then they will disappear as I don't select all now.

    So I want to know if there is a way to always highlight all fields so that I can check them? Thanks.
     
    Raenty, May 17, 2017
    #1
    LindaSmart likes this.
    1. Advertisements

  2. Raenty

    Tadies

    Joined:
    May 20, 2017
    Messages:
    1
    Likes Received:
    1
    There are a lot of ways to do that. For example:

    1. Open "Word Options", and in "Advanced", set the“Field shading” option as “Always”.

    2. Use“Find”Function, just use “^d”to find all fields and choose to highlight them .

    3. Use VBA. Below is a macro I find.

    Code:
    Sub ShowFieldsInDoc()
      Dim objField As Field
      Dim objDoc As Document
      Dim strCodeText As String
      Set objDoc = ActiveDocument
      With objDoc
        For Each objField In .Fields
          If objField.Type = wdFieldRef Or wdFieldPageRef Then
            objField.Select
            Selection.Range.HighlightColorIndex = wdYellow
          End If
          If objField.Type = wdFieldHyperlink Then
            objField.Select
            Selection.Range.HighlightColorIndex = wdNoHighlight
          End If
        Next objField
      End With
    End Sub
    More details you can see at

    https://www.datanumen.com/blogs/3-quick-ways-find-fields-word-document/

    Hope it heps.
     
    Tadies, May 20, 2017
    #2
    LindaSmart likes this.
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.