PDA

View Full Version : Don't show command button when printing



Xenowyn
08-07-2014, 03:18 PM
I have a document with a command button in it and I need a way to print document without the command button showing up on the printed page. There's a little bit of documentation that I've found on this issue, like messing with the visibility of the command button (which in itself didn't even work), but nothing that I've found has worked for me. Too bad there isn't a PrintObject field in the properties list like there is in excel... Any help would be appreciated.

macropod
08-07-2014, 11:19 PM
See: http://answers.microsoft.com/en-us/office/forum/office_2010-customize/macro-that-ungroups-text-and-deletes-the-entire/093b8bb2-a8fb-4f7f-a69d-30ce23bb323f

Xenowyn
08-08-2014, 07:19 AM
Oh cool! So I tried it with that code of yours and it works in deleting the button then undoing it, but when it prints the button still shows up...

It seems FilePrint() no longer intercepts the File > Print command?

macropod
08-08-2014, 04:00 PM
IIRC, FilePrint() has been somewhat deprecated. It still intercepts the File > Print command, but that's no longer used for all print operations.

fumei
08-09-2014, 02:48 AM
Just as a point...

The command fired by File > Print is different from the command that is fired when you click the Print button.

File > Print fires FilePrint().
Clicking the Print button fires FilePrintDefault().

Or at least the USED to. I do not know what later versions fire. But it is still likely they are different.