Is there an "on print" property like in Access?

  • Thread starter Southern at Heart
  • Start date
S

Southern at Heart

When the user clicks on the print button to print a document made by my
custom template, I need to execute a macro afterwards. Is there something
like an "on print" property that I can add to my template that will have this
affect on all documents made from it?
thanks,
Southern at Heart
 
J

Jay Freedman

When the user clicks on the print button to print a document made by my
custom template, I need to execute a macro afterwards. Is there something
like an "on print" property that I can add to my template that will have this
affect on all documents made from it?
thanks,
Southern at Heart

It isn't quite a case of running a separate macro after printing. You write a
macro with the specific name FilePrint, and that macro executes _instead_ of the
built-in Print command on the File menu. That macro can do whatever you need it
to do, and one of the things it should do is call
Dialogs(wdDialogFilePrint).Show to display the Print dialog and actually print
the document.

You'll also want a similar macro named FilePrintDefault that intercepts the
print button on the toolbar. That one should, among other things, call
ActiveDocument.PrintOut Background:=False to carry out the printing without
showing the dialog.

See http://www.word.mvps.org/FAQs/MacrosVBA/InterceptSavePrint.htm.
 

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