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 - 01 Jun 2005 08:21 GMT
G'day venukus@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
venukus@gmail.com reckoned:
>Hi all,
>
[quoted text clipped - 16 lines]
>Thanks in Advance,
>Venu Gopal
Doug Robbins - 04 Jun 2005 06:10 GMT
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.

Signature
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
> Hi all,
>
[quoted text clipped - 16 lines]
> Thanks in Advance,
> Venu Gopal