<

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

Microsoft Word - Prevent Printing

Published on
21,415 Points
14,815 Views
6 Endorsements
Last Modified:
Approved
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.
6
Comment
Author:Lee Osborne
0 Comments

Featured Post

CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

Join & Write a Comment

In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month