Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Ephrata, Washington, USA
    Posts
    683
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Button on form to reset fields (2003)

    Someone has asked me how to put a button on a form in Word that will reset the fields. I have not used the activex controls before. I know how to use the form toolbar to reset the fields. I tried using that button and then copying the code to an activex control, but it doesn't work. Obviously, I haven't a clue how to do this.

    Help? The user needs this to be a simple button, but she wants it in the document, not on a toolbar.

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

    Re: Button on form to reset fields (2003)

    Unprotect your document.
    Click in the document where you want the button.
    Show the Control Toolbox toolbar.
    Click on the 'Command Button' toolbar button.
    A command button will appear in your document and Design Mode will be turned on.
    You can drag the command button to another position if you like.
    Double click the command button.
    Make the code look like this:
    <code>
    Private Sub CommandButton1_Click()
    ActiveDocument.Unprotect
    ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=False
    End Sub
    </code>
    Switch back to Word.
    Turn off Design Mode by clicking the first button on the Control Toolbox.
    Protect your document for Forms again.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Ephrata, Washington, USA
    Posts
    683
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Button on form to reset fields (2003)

    Thank you, Hans. I knew how to create the command button, but I am so code illiterate, that I didn't know how to make it actually do anything! This works beautifully.

Posting Permissions

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