• How to search for a macrobutton field (2000/2007)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » How to search for a macrobutton field (2000/2007)

    Author
    Topic
    #455287

    I know that I can use F11 to find the next field in a document, and I can also use Find to find the next field, but I want to find specifically the next Macrobutton field. Could a macro do that? And if so, could anyone help with the code?

    Thanks…
    Adri

    Viewing 0 reply threads
    Author
    Replies
    • #1132607

      Interactively, you can display field codes (Alt+F9) and search for the word MACROBUTTON, or if you want to select the entire field, search for ^d MACROBUTTON (^d is the code to search for a field in the Find dialog; you must display field codes for it to work).

      You can loop through fields in a macro:

      Sub LoopFields()
      Dim fld As Field
      For Each fld In ActiveDocument.Fields
      If fld.Type = wdFieldMacroButton Then
      ‘ Your code here

      End If
      Next fld
      End Sub

      • #1132617

        Thanks Hans…you’re always so helpful.

        Adri

    Viewing 0 reply threads
    Reply To: How to search for a macrobutton field (2000/2007)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: