Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jun 2001
    Location
    Vancouver, Br. Columbia
    Posts
    57
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

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

    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

  3. #3
    Star Lounger
    Join Date
    Jun 2001
    Location
    Vancouver, Br. Columbia
    Posts
    57
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    Thanks Hans...you're always so helpful.

    Adri

Posting Permissions

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