The purpose of this page is to explain how to print a protected form that contains an ActiveX print button without the button appearing in the print.
In the above illustration there is an ActiveX button inserted from the ActiveX legacy controls on the Developer tab of the ribbon.
Create a new character style, based simply on the underlying paragraph and call it 'Hidden'. The name is not that important, but it handily reflects the function it will be put to. We are only interested in having the name available to apply to the button, so the next step is to apply the style to the button.
As the style is exactly the same as the underlying style, at this point, nothing will appear to change. This is the default condition.
With Design Mode selected from the Developer Tab, right click the button and select 'View Code'. Copy and paste the following code to the vba editor:
Close the VBA editor. Protect and Save the form as a macro enabled document or template.
The form is now ready for completion (or in the case of a template for new documents to be created from it).
Fill in the data and click the button. The 'Hidden' style will be formatted as hidden. The document will be sent to the printer, and the style will be returned to its default state. Nothing will appear to happen to the form itself. The form will remain protected, but the printout will not display the button.
This page was inspired by a question I responded to in the MSDN VBA forum. It provides a way of printing a form via a Print button in the form, but without the button appearing in the print-out.