Print Page | Close Window

Pages to Print Setting

Printed From: www.exp-systems.com
Category: PDF reDirect
Forum Name: Programming
Forum Discription: VBA and Batch Tools to control PDF reDirect Pro
URL: http://www.exp-systems.com/Forum_exp/forum_posts.asp?TID=421
Printed Date: 26 Apr 24 at 7:47AM


Topic: Pages to Print Setting
Posted By: PumaTex
Subject: Pages to Print Setting
Date Posted: 22 May 08 at 6:58AM
In producing booklets in PDF format I need to specify the number and order of pages to print.  Can "Print Page Numbers" setting on a Word document being converted to PDF be specified from VBA?   If so how?   Thanks in advance.



Replies:
Posted By: Michel_K17
Date Posted: 04 Jun 08 at 10:15PM
Yes, you can specify which pages are printed from Word VBA.

The VBA Method is "PrintOut". For example:

ActiveDocument.PrintOut

The syntax is:

.PrintOut(Background, Append, Range, OutputFileName, From, To, Item, Copies, Pages, PageType, PrintToFile, Collate, FileName, ActivePrinterMacGX, ManualDuplexPrint, PrintZoomColumn, PrintZoomRow, PrintZoomPaperWidth, PrintZoomPaperHeight)

You will want to set the Range, From, To and/or the Pages properties as follows:

Range   Optional Variant. The page range. Can be one of the following WdPrintOutRange constants: wdPrintAllDocument, wdPrintCurrentPage, wdPrintFromTo, wdPrintRangeOfPages, or wdPrintSelection.

OutputFileName   Optional Variant. If PrintToFile is True, this argument specifies the path and file name of the output file.

From   Optional Variant. The starting page number when Range is set to wdPrintFromTo.

To   Optional Variant. The ending page number when Range is set to wdPrintFromTo.

Pages   Optional Variant. The page numbers and page ranges to be printed, separated by commas. For example, "2, 6-10" prints page 2 and pages 6 through 10.

Hopefully this will get you going.



-------------
Michel Korwin-Szymanowski
EXP Systems LLC



Print Page | Close Window