Microsoft Word - Prevent Printing

Published on
20,296 Points
6 Endorsements
Last Modified:
Like many others, we try and discourage users from printing documents unnecessarily and instead send or share them electronically. However, this doesn't always work and documents are still printed.

With this simple solution, if the user tries to print, a dialog box immediately appears informing the user "This document cannot be printed" (or words of your choosing!) and the print command is cancelled.

You can prevent Word from printing a document by adding a small peice of code which will disable Ctrl+P, File > Print, and the Print toolbar button.

From within your document (or template), click on Tools > Macros > Visual Basic Editor  (or Alt+F11).

In the top left window, double click on 'ThisDocument'.

Simply paste the attached code into the code window on the right, change the message you wish to be displayed, and press Save. Close the Visual Basic Editor, and close your document.

The next time this document is opened, the code will take effect and printing is disabled.

This technique can also be applied to your company templates so that all documents have this feature installed by default.

Dim WithEvents WordApp As Application

Private Sub Document_New()
    Set WordApp = Application
End Sub

Private Sub Document_Open()
    Set WordApp = Application
End Sub

Private Sub WordApp_DocumentBeforePrint(ByVal Doc As Document, Cancel As Boolean)
    'Text displayed to the user if they try to print
    strMessage = "This document cannot be printed."
    MsgBox strMessage, vbOKOnly + vbExclamation, "Print"
        Cancel = True

End Sub

Open in new window

Note: Technically savvy users can disable macros, however, with this solution you are simply trying to minimize not eliminate excessive printing.
Author:Lee Osborne

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Join & Write a Comment

This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month