pop up window before printing

M

Mesi

Hi all,

I would like to create just a simple fax template which includes the
feature that before printing the fax document a window will pop up
with a custimized question that has to be answered (yes or no) , yes
for printing, no for stop print routine.
Can somebody help me ?
Thanks a million.

MESI
 
S

Shauna Kelly

Hi Mesi

Copy the following code into your fax template. It will then only run
when you're using a document based on that template.

Replace the text "Type your custom question here" with your text. The
code will intercept the File > Print command. If the user clicks Yes,
then the print dialog will be displayed. Otherwise, nothing happens.

If you're not sure what to do with the code, see
http://www.gmayor.dsl.pipex.com/installing_macro.htm. To understand
what's going on, see
http://www.mvps.org/word/FAQs/MacrosVBA/InterceptSavePrint.htm.

Hope this helps.

Shauna

Option Explicit

Sub FilePrint()
'Shauna Kelly, 7 November 2003
'for microsoft.public.word.docmanagement
'
'Purpose: Only print if the user answers "yes"
'to the question

If MsgBox( _
"Type your custom question here", _
vbYesNo + vbQuestion) = vbYes Then
Dialogs(wdDialogFilePrint).Show
Else
'Do nothing
End If

End Sub



Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
Melbourne, Australia
 

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