Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent Command Button from Printing 1

Status
Not open for further replies.

Jamie_S

Technical User
Nov 2, 2018
3
US
I'm creating a Word template, when the user completes the template they click on the E-mail command button which opens up an e-mail and attaches the template to it, then the user sends the e-mail.

When the receiver opens the e-mailed template and prints the template the E-mail command button prints. I want to prevent the command button from printing.

I have placed the following coding within my command button but it prints the form out when the user clicks the button to send the template via e-mail.

With ActiveDocument
.Shapes(1).Visible = msoFalse
.PrintOut Background:=False
.Shapes(1).Visible = msoTrue
End With

My question is, can I put the above coding into a Sub FilePrint(), so that the button won't print when the receiver prints the e-mailed template?

Thanks
 
>I want to prevent the command button from printing.

In the template, make sure the button is selcted button, then bring up the font dialog, and tick the Hidden box. Button will now appear on screen, but will not print

(note that in future you might be better off asking Office-related questions in forum68)
 
Hi strongm, thank you for your response. My apologies for posting this in the wrong area. This was my first post to this site.

In the Font dialog box under Effects there are two options Strikeout and Underline. There is no Hidden box choice, am I in the wrong area? I'm using Word 2016.

Let me know if you would prefer that I repost this in forum68: Microsoft: Office.

Thanks,
Jamie
 
>am I in the wrong area?

Yep! You need the Font dialog from the Home tab on the Ribbon. Not via Properties on the right-click menu, or however it was you got to the dialog you describe - you are trying to set the font properties used by the control itself, whilst we want to modify a document level property
 
Hi strongm, thanks for your direction. I went to the Font properties on the Home ribbon and choose Hidden. So just to go through the steps, I completed the template, clicked on the E-mail command button, Outlook opens and attaches the template, I sent the e-mail.

When the receiver opens the e-mailed template and prints the form, the E-mail command button shifts to the upper left corner of the document instead of staying where it was originally placed in the template. Not sure why that is happening, I've looked in the button properties and cannot seem to figure that out.

But, the button does not print, so that's the result I wanted; I just wish the E-mail command button wouldn't move.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top