Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
Programming
 EXP Systems Forum : PDF reDirect : Programming
Topic: Pages to Print Setting Post Reply Post New Topic
Author Message
PumaTex
Newbie
Newbie


Joined: 22 May 08
Location: United States
Posts: 1
Quote PumaTex Replybullet Topic: Pages to Print Setting
    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.
IP IP Logged
Michel_K17
Moderator Group
Moderator Group
Avatar
Forum Administrator

Joined: 25 Jan 03
Posts: 1673
Quote Michel_K17 Replybullet 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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum