Microsoft Word - Prevent Printing

AID: 3364
  • Status: Published

2760 points

  • ByLeeOsborneUK
  • TypeTips/Tricks
  • Posted on2010-07-02 at 00:44:31
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

                                    
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:

Select allOpen in new window



Note: Technically savvy users can disable macros, however, with this solution you are simply trying to minimize not eliminate excessive printing.
Asked On
2010-07-02 at 00:44:31ID3364
Tags

Microsoft Word

,

Prevent Printing

,

No Printing

,

Disable Print

Topic

Microsoft Word

Views
2042

Comments

Add your Comment

Please Sign up or Log in to comment on this article.

Join Experts Exchange Today

Gain Access to all our Tech Resources

Get personalized answers

Ask unlimited questions

Access Proven Solutions

Search 3.2 million solutions

Read In-Depth How-To Guides

1000+ articles, demos, & tips

Watch Step by Step Tutorials

Learn direct from top tech pros

And Much More!

Your complete tech resource

See Plans and Pricing

30-day free trial. Register in 60 seconds.

Loading Advertisement...

Top MS Word Experts

  1. GrahamSkan

    296,430

    Guru

    2,000 points yesterday

    Profile
    Rank: Genius
  2. teylyn

    43,476

    2,400 points yesterday

    Profile
    Rank: Genius
  3. chris_bottomley

    42,500

    0 points yesterday

    Profile
    Rank: Genius
  4. EricFletcher

    32,732

    0 points yesterday

    Profile
    Rank: Sage
  5. dlmille

    31,800

    0 points yesterday

    Profile
    Rank: Genius
  6. thinkpads_user

    21,832

    0 points yesterday

    Profile
    Rank: Genius
  7. finalword

    18,868

    0 points yesterday

    Profile
    Rank: Guru
  8. l33tf0b

    17,269

    0 points yesterday

    Profile
    Rank: Wizard
  9. BillDL

    15,550

    0 points yesterday

    Profile
    Rank: Genius
  10. Flyster

    15,000

    0 points yesterday

    Profile
    Rank: Sage
  11. puppydogbuddy

    14,700

    0 points yesterday

    Profile
    Rank: Genius
  12. paulsauve

    13,968

    2,000 points yesterday

    Profile
    Rank: Sage
  13. matthewspatrick

    13,186

    10 points yesterday

    Profile
    Rank: Savant
  14. PandaPants

    13,000

    0 points yesterday

    Profile
    Rank: Master
  15. regmigrant

    12,500

    0 points yesterday

    Profile
    Rank: Guru
  16. KCTS

    11,953

    0 points yesterday

    Profile
    Rank: Genius
  17. Helen_Feddema

    11,826

    0 points yesterday

    Profile
    Rank: Genius
  18. aikimark

    11,500

    0 points yesterday

    Profile
    Rank: Genius
  19. CodeCruiser

    9,000

    0 points yesterday

    Profile
    Rank: Genius
  20. GasperK

    8,498

    0 points yesterday

    Profile
    Rank: Master
  21. RobSampson

    8,200

    0 points yesterday

    Profile
    Rank: Genius
  22. motnahp00

    8,136

    0 points yesterday

    Profile
    Rank: Sage
  23. TBone2K

    7,600

    0 points yesterday

    Profile
    Rank: Sage
  24. ogctech

    7,600

    0 points yesterday

    Profile
  25. Rartemass

    7,400

    0 points yesterday

    Profile
    Rank: Wizard

Hall Of Fame