Word

Print All Open Documents

Ease of Use

Easy

Version tested with

2000 

Submitted by:

TonyJollans

Description:

A simple routine to print all documents currently open. 

Discussion:

For all sorts of reasons you may have multiple Word documents open and want to print all of them at one go. This will do it for you - you can run it from any document, or even from normal.dot. 

Code:

instructions for use

			

Sub PrintAll() Dim objDoc As Document On Error Resume Next For Each objDoc In Application.Documents objDoc.PrintOut Next objDoc Set objDoc = Nothing End Sub

How to use:

  1. Copy the code above.
  2. Open Word.
  3. Press Alt + F11 to open the Visual Basic Editor (VBE).
  4. Click on "Normal" at the left.
  5. Select Insert-Module from the Menu
  6. Paste the code into the window at the right.
  7. Click on the diskette button on the toolbar to save it
  8. Close the VBE
 

Test the code:

  1. Open at least two Word documents.
  2. Press Alt + F8 to get the Macros Dialog.
  3. Select "normal.dot (global template)" from the "Macros In" dropdown near the bottom
  4. Double click on "PrintAll" in the macro list above.
  5. Check your printer!
 

Sample File:

No Attachment 

Approved by Anne Troy


This entry has been viewed 62 times.

Please read our Legal Information and Privacy Policy
Copyright @2004 - 2020 VBA Express