FilePrint Question

  • Thread starter Montana DOJ Help Desk
  • Start date
M

Montana DOJ Help Desk

Word 2000

I have the following subroutine:

Sub FilePrint()

Message = "FilePrint"
PrintRecords

End Sub

My goal here is to have FilePrint run every time the document is printed, no
matter how the user prints the document. When I select "Print" from the
File menu, or use CTRL+P, I get the "FilePrint" message, indicating that the
FilePrint routine ran. However, if I print by clicking the Print button on
the toolbar, I get no message at all, but the document still prints,
indicating that the FilePrint routine is not running when the Print button
on the toolbar is used.

Is there a way to intercept the print operation when the user clicks the
Print button on the toolbar?

I've searched in the VB Help and have come up empty. Currently, the only
solution I can think of is to create a custom toolbar that is identical to
the Standard toolbar, except that the Print button would call the FilePrint
macro.

-- Tom

State of Montana
Department of Justice Help Desk

"Making the world a safer place."
 
D

Doug Robbins

You will need a macro with the name of each of Word's built in commands that
cause the document to be printed.

FilePrintDefault

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
M

Montana DOJ Help Desk

That's what I was trying to do (I did the same thing with EditPaste), but I
didn't know the name of the built-in command. I was trying to find it in
Help, but I was searching on "FilePrint" and was coming up with nada.

Anyway, thanks for the pointer. I'll have to wait until tomorrow night to
give it a try.

--Tom

State of Montana
Department of Justice Help Desk

"Making the world a safer place."
 
M

Montana DOJ Help Desk

I got it working. Initially, I misunderstood your reply. I was thinking
that a macro named FilePrintDefault would cover all scenarios. But it seems
to only work for the Print button on the toolbar. So I now have a FilePrint
macro to cover when the document is printed from the File menu, or using
CTRL+P, and a FilePrintDefault macro to cover when the document is printed
using the toolbar button.

Thanks for the help!

-- Tom

State of Montana
Department of Justice Help Desk

"Making the world a safer place."
 

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