Reading and Printing Word Documents in WSH - Advanced Printing Options
(Page 3 of 5 )
Okay, so simply printing a document may not be enough for you. After all, what if you want to print multiple copies or just specific page ranges? Most of the settings available in Word’s Print… dialog are also available through the Word automation object.
In most cases, there are two different ways to specify these settings: as parameters to the PrintOut method or as property settings of either the Options object or the PageSetup object.
Select Properties of the Options object |
PrintBackground | A Boolean value that indicates whether Word prints in the background. |
PrintBackgrounds | A Boolean value that indicates whether background colors and images are printed. |
PrintComments | True if Microsoft Word prints comments, starting on a new page at the end of the document. Read/write Boolean. |
PrintDraft | True if Microsoft Word prints using minimal formatting. Read/write Boolean. |
PrintDrawingObjects | True if Microsoft Word prints drawing objects. Read/write Boolean. |
PrintEvenPagesInAscendingOrder | True if Microsoft Word prints even pages in ascending order during manual duplex printing. Read/write Boolean. |
PrintFieldCodes | True if Microsoft Word prints field codes instead of field results. Read/write Boolean. |
PrintHiddenText | True if hidden text is printed. Read/write Boolean. |
PrintOddPagesInAscendingOrder | True if Microsoft Word prints odd pages in ascending order during manual duplex printing. Read/write Boolean. |
PrintProperties | True if Microsoft Word prints document summary information on a separate page at the end of the document. Read/write Boolean. |
PrintReverse | True if Microsoft Word prints pages in reverse order. Read/write Boolean. |
PrintXMLTags | Returns a Boolean that represents whether to print the XML tags when printing a document. Corresponds to the XML tags check box on the Print tab in the Options dialog box. |
You’ve already seen how we’ve used the PrintBackground property in the examples provided so far. Let’s look at a couple more possible implementations.
objWord.Options.PrintDraft = True
objWord.Options.PrintHiddenText = False
This code sample will enable Draft printing while instructing Word not to print hidden text.
Next: Page Setup options >>
More Windows Scripting Articles
More By Nilpo