Discussion:
Help - Disable Printing
(too old to reply)
v***@gmail.com
2005-05-12 14:28:58 UTC
Permalink
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
Word Heretic
2005-06-01 07:22:43 UTC
Permalink
G'day ***@gmail.com,

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
Post by v***@gmail.com
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
Doug Robbins
2005-06-04 05:10:36 UTC
Permalink
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
Post by v***@gmail.com
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
Loading...