Article View: adobe.scripting.indesign
Article #16628[VBS] Printing a Page Range
From: Paul Jurgens
Date: Wed, 20 Aug 2003 21:36
Date: Wed, 20 Aug 2003 21:36
28 lines
1768 bytes
1768 bytes
I am trying to print certain pages within a document based upon the master page that has been applied to that page.
I can get a handle on each page but when I try to set the page range using the name of the page (the page number) it does not set. The entire document prints.
My VB Script is below. Any idea why I can't set the page range?
Paul
Dim myInDesign
Set myInDesign = CreateObject("InDesign.Application.2.0")
Set myDocument = myInDesign.ActiveDocument
REM Count the pages and set the default print style
numPages = myDocument.Pages.Count
myDocument.PrintPreferences.ActivePrinterStyle = idDefaultStyle
REM Cycle through pages
For p = 1 To numPages
Set myPage = myDocument.Pages.Item(p)
REM If correct master, print page
If myPage.AppliedMaster = "B-Ground" Then
myDocument.PrintPreferences.PageRange = myPage.Name
myDocument.PrintOut idPrintWithoutDialog
REM The variable below is just turned on to prevent it from cycling until the problem is solved
REM p = numPages
End If
Next
Technical Details
Message-ID:
<2cccfedc.-1@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webxShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,a492f3714138d31a,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-08-20 14:40:02 PST From: "Paul Jurgens" <flynfall@yahoo.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: [VBS] Printing a Page Range Message-ID: <2cccfedc.-1@webx.la2eafNXanI> Date: Wed, 20 Aug 2003 14:36:18 -0700 Lines: 32 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit