Windows Scripting
  Home arrow Windows Scripting arrow Page 3 - Reading and Printing Word Documents in WSH
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

Reading and Printing Word Documents in WSH
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2008-10-13

    Table of Contents:
  • Reading and Printing Word Documents in WSH
  • Printing Word Documents
  • Advanced Printing Options
  • Page Setup options
  • Printing Page Ranges and more

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    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.

    More Windows Scripting Articles
    More By Nilpo


       · In the second installment of this series, I show readers some of the more advanced...
     

    WINDOWS SCRIPTING ARTICLES

    - More Windows Scripting Workarounds from Nilpo
    - Overloading Methods and More in VBScript
    - Improving MFC for Windows Vista
    - Regular Expressions in VBScript
    - Working with Dates in WMI
    - Completing Calendars with VBScript Date Func...
    - Building Calendars with VBScript Date Functi...
    - Working With Dates and Times in VBScript
    - Designing WCF DataContract Classes Using the...
    - Understanding Dates and Times in VBScript
    - Working With Arrays in VBScript
    - Compressed Folders in WSH
    - Using .NET Interops in VBScript
    - Nilpo`s Scripting Secrets, Vol I
    - Database operations using Silverlight 2.0 WC...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek