Help - Disable Printing

V

venukus

Hi all,

I am writing a COM Add-in for Word 2000.

I assume the code below should disable printing,

Private Sub App_DocumentBeforePrint(ByVal Doc As Word.Document, ByRef
Cancel As Boolean) Handles App.DocumentBeforePrint
MsgBox("Printing is disabled")
Cancel = True
End Sub

But I can see the message saying "Printing is disabled" but the print
command carries on and the document is printed. I have seen most of the
earlier postings but no one seem to have such a problem.

Any help is appreciated.

Thanks in Advance,
Venu Gopal
 
W

Word Heretic

G'day (e-mail address removed),

Your routine runs BEFORE the print, it does not DO the print.

Sub FilePrint()
MsgBox "Printing has been disabled."
End Sub

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


(e-mail address removed) reckoned:
 
D

Doug Robbins

In Addition to Steve's response, you will also need a macro
FilePrintDefault() to trap the user's use of the print button on the
toolbar. You may also want to have one FilePrintPreview() as well.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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