title: Hide commandbutton to print document via a created button
body: <p>This is my first post on here, I will try to be as clear as possible :)</p>
  <p>I'm creating a Microsoft Word form for users to fill in, this form is protected and only the forms can be filled in the rest of the document is protected with the password: &quot;mypass&quot;</p>
  <p>I want to have a button on the document it self wich prints the active document. What I did is create a print button into a “drawing” Textbox ( Insert | Textbox ) as stated <a href="http://word.mvps.org/faqs/tblsfldsfms/HidePrintButton.htm" rel="nofollow noreferrer">here</a>.</p>
  <p>This Print button must be hidden so it's not visible on the document when it's printed.</p>
  <p>Here is the code:</p>
  <pre><code>Private Sub CommandButton1_Click()
  
  If ActiveDocument.ProtectionType &lt;&gt; wdNoProtection Then
  ActiveDocument.Unprotect Password:=&quot;mypass&quot;
  End If
  
  With ActiveDocument
      .Shapes(1).Visible = msoFalse
      .PrintOut Copies:=1
      .Shapes(1).Visible = msoTrue
  End With
  
  ActiveDocument.Protect Type:=wdAllowOnlyFormFields, Password:=&quot;mypass&quot;
  
  End Sub
  </code></pre>
  <p>When I click the print button in protective mode nothing happens, when I turn off protective mode I get this error:</p>
  <blockquote>
  <p>Error 4641 at run.</p>
  <p>ToolsProtectDocument statement is currently disabled</p>
  </blockquote>
  <p>To summarize:</p>
  <p>The Print button I created does not work when protective mode is enabled.
  When protective mode is disabled I get the error that the ToolsProtectDocument statement is currently disabled.</p>
  <p>I want to have a procted form that can be filled in and be printed from the form itself without the print button being visable on the printed form.</p>
  <p>Does anyone have a clue?</p>