Share via

command button protected document - Word 2010

Anonymous
2013-10-22T00:17:11+00:00

Hello

I have added a command button and using the click event. The document is restricted from editing allowing the user to fill in the form fields. The goal is to make it easier for the user to send the document to a specific address after the form fields are complete. This works as designed if the document is not protected. When protected, the button does not execute for some users. Some users can click and hold the button to get execution of the code.

What can is the best way to create submission process for our users?

Private Sub CommandButton1_Click()

ActiveDocument.SendForReview _

Recipients:=MyAddress@Microsoft.com, _

Subject:="Hydralada Maxi Quote", _

ShowMessage:=True, _

IncludeAttachment:=True

MsgBox "Your Message has been sent!"

End Sub

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Anonymous
    2015-01-08T22:12:48+00:00

    What I have done is to create separate sections for protected and unprotected parts of the document.  When you turn protection on (Developer tab => Protect section => Restrict Editing button), you can select which sections to protect (unprotect the section containing [just] the button ).  This allowed me to embed documents into my document in that section.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2013-10-23T12:07:03+00:00

    No. There is no validation of the form fields. The button is at the end of the document outside a table. Just a Submit macro:

    Private Sub CommandButton1_Click()

    ActiveDocument.SendForReview _

    Recipients:=MyAddress@Microsoft.com, _

    Subject:="Hydralada Maxi Quote", _

    ShowMessage:=True, _

    IncludeAttachment:=True

    MsgBox "Your Message has been sent!"

    End Sub

    Was this answer helpful?

    0 comments No comments
  3. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2013-10-23T06:55:02+00:00

    Are you using the macrobutton to run a macro that contains the necessary code to validate that the necessary formfields have data entered into them and if so the email the document?

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2013-10-22T23:47:10+00:00

    Thank you Doug.

    I added the MacroButton field. I am getting the same behavior as the Command Button. When the user clicks on the MacroButton or the Command Button, the focus jumps to the first field in the document. Is there a tab order - Focus issue - or a specific location that these controls need to added?

    Damon

    Was this answer helpful?

    0 comments No comments
  5. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2013-10-22T02:59:27+00:00

    See the article "Using MacroButton fields” at:

    http://www.word.mvps.org/FAQs/TblsFldsFms/UsingMacroButton.htm

    Was this answer helpful?

    0 comments No comments