Hidding all buttons in document before print

T

Tony Starr

Is there a way to hide all the buttons in a document so that they will not
appear when the document is printed?

TIA
Tony
 
J

Jay Freedman

Tony said:
Is there a way to hide all the buttons in a document so that they
will not appear when the document is printed?

TIA
Tony

What kind of buttons? There are different kinds, and the answer is different
for each kind.

If you have buttons from the Control Toolbox, see
http://www.word.mvps.org/FAQs/TblsFldsFms/HidePrintButton.htm.

If they're MacroButton fields, define a character style in the template that
you apply to each MacroButton field. Write a FilePrint macro that intercepts
the File > Print command
(http://www.word.mvps.org/FAQs/MacrosVBA/InterceptSavePrint.htm). In the
macro, change the style's .Font.Hidden attribute to True, show the print
dialog, and then change the style's .Font.Hidden back to False.
Alternatively, change the .Font.Color to white before printing and back to
auto afterward; that will preserve the space occupied by the fields. You
probably also want to write a similar macro named FilePrintDefault that
intercepts the "quick print" button on the toolbar; instead of showing the
dialog, this one just calls the document's .PrintOut method.

Another alternative is not to put the buttons in the document at all, but
add them to a custom toolbar. Then you don't have to fool around with hiding
them and unhiding them.
 
H

Helmut Weber

Hi Tony,

maybe you can adapt this to your needs.

Sub test1()
Dim oCtrl As InlineShape
ActiveWindow.View.ShowHiddenText = False
For Each oCtrl In ActiveDocument.InlineShapes
If oCtrl.Type = wdInlineShapeOLEControlObject Then
oCtrl.Range.Font.Hidden = Not oCtrl.Range.Font.Hidden
End If
Next
End Sub

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top