Results 1 to 12 of 12
  1. #1
    Star Lounger
    Join Date
    Jun 2001
    Location
    California
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reset Form Fields (Word 2007)

    I have a table I've created with several drop down boxes in it. I was hoping to find an easy way to just reset all of the fields back to blank and haven't had any luck finding anything. Any advise?

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

    Re: Reset Form Fields (Word 2007)

    Try unprotecting then reprotecting the document.

  3. #3
    Star Lounger
    Join Date
    Jun 2001
    Location
    California
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reset Form Fields (Word 2007)

    I tried that, it doesn't work in 2007. <img src=/S/bummer.gif border=0 alt=bummer width=15 height=15>

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

    Re: Reset Form Fields (Word 2007)

    Does this work in Word 2007 (I don't have it myself):
    - Press Alt+F11 to activate the Visual Basic Editor.
    - Press Ctrl+G to activate the Immediate window.
    - Type ActiveDocument.Unprotect and press Enter.
    - Type ActiveDocument.Protect wdAllowOnlyFormFields, False and press Enter.
    The argument False should ensure that all form fields are reset.
    If there's a password for unprotecting/protecting the document, use

    ActiveDocument.Unprotect "Secret"
    ActiveDocument.Protect wdAllowOnlyFormFields, False, "Secret"

    where Secret is the password.

  5. #5
    Star Lounger
    Join Date
    Jun 2001
    Location
    California
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reset Form Fields (Word 2007)

    Thank you Hans,

    That didn't work either.

    The 2007 forms fields don't clear when you unprotect and then reprotect. I hated that feature before, but could sure use it now! )

    Any other tricks up your sleeve?

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

    Re: Reset Form Fields (Word 2007)

    If you activate the Developer tab of the Ribbon and click the Tools icon in the lower right corner of the controls gallery section, you get a dropdown containing a Legacy Forms and an ActiveX section. The last button in the Legacy Forms section is 'Reset Form Fields'.
    Attached Images Attached Images
    • File Type: png x.png (5.2 KB, 9 views)

  7. #7
    Star Lounger
    Join Date
    Jun 2001
    Location
    California
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reset Form Fields (Word 2007)

    Wow, I thought you had it, but that only works on legacy fields too, not 2007 fields. <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>

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

    Re: Reset Form Fields (Word 2007)

    Sorry, no. As I mentioned, I don't have Word 2007 myself.

    Perhaps you should avoid the new Word 2007 fields for the time being?

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Reset Form Fields (Word 2007)

    Can you post a sample form with the relevant mix of fields? I have Word 2007 at home and can try it out there.

  10. #10
    Star Lounger
    Join Date
    Jun 2001
    Location
    California
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reset Form Fields (Word 2007)

    This isn't the best, but it was the quickest... Thank you for trying!

  11. #11
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Reset Form Fields (Word 2007)

    These controls are strange. You can access them using ActiveDocument.ContentControls. But then... there is no obvious way to reset the value. For a ComboBox, it appears that you can set the control's .Range.Title to the .PlaceholderText.Value. I didn't study all of them closely, but you can inspect their properties by using this little procedure and the Locals window.

    <code>Sub SniffControls()
    Dim cc As Word.ContentControl
    For Each cc In ActiveDocument.ContentControls
    Stop
    Next
    If Not (cc Is Nothing) Then Set cc = Nothing
    End Sub</code>

  12. #12
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Re: Reset Form Fields (Word 2007)

    I'm just feeling out the content controls in Word 2007. Try this for clearing out the dropdown lists; you could modify this bit of code to include combo boxes as well:

    Sub ClearCCDropdowns()
    Dim cc As ContentControl
    For Each cc In ActiveDocument.ContentControls
    If cc.Type = wdContentControlDropdownList Then
    cc.DropdownListEntries.Clear
    End If
    Next
    End Sub

Posting Permissions

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