Article View: adobe.scripting.indesign
Article #19984Re: Page Size and Orientation NOT working
From: Olav Kvern
Date: Sun, 10 Nov 2002 07:33
Date: Sun, 10 Nov 2002 07:33
36 lines
2270 bytes
2270 bytes
Bill--
Sorry I didn't get to this one earlier. I took most of the week off to try to sort out various non-work things. Anyway, try something like this:
Dim myInDesign As InDesign.Application
Set myInDesign = CreateObject("InDesign.Application.2.0")
Set myDocument = myInDesign.Documents.Add
Rem Set the measurement units to millimeters
myDocument.ViewPreferences.HorzMeasurementUnits = idMSMillimeters
myDocument.ViewPreferences.VertMeasurementUnits = idMSMillimeters
Set myDocPreferences = myDocument.DocumentPreferences
myDocPreferences.PageWidth = 253
myDocPreferences.PageHeight = 177
myDocPreferences.PagesPerSpread = 1
Set myMasterSpread = myDocument.MasterSpreads.Item(1)
Set myMasterPage = myMasterSpread.Pages.Item(1)
Set myMarginPreferences = myMasterPage.MarginPreferences
myMarginPreferences.MarginLeft = 6
myMarginPreferences.MarginTop = 25
myMarginPreferences.MarginRight = 6
myMarginPreferences.MarginBottom = 25
Rem Do this after setting margins.
myDocPreferences.PageOrientation = idLandscape
I'd also note that you need to pare down your example code to just the issue that you're having trouble with, and remove the parts that have to do with your user interface. Very few of the posters have time to dig through a long listing, and the UI stuff just gets in the way of showing the problem you want to show.
Alan Stearns always gets after me for giving him 20 lines of code to demonstrate an error when all he needs is the one that fails!<g>
Thanks,
Ole
Technical Details
Message-ID:
<1de67ce8.1@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de67ce8.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,e817c558ea6d46ce X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-11-09 23:42:01 PST From: "Olav Kvern" <okvern@adobe.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Page Size and Orientation NOT working Message-ID: <1de67ce8.1@WebX.la2eafNXanI> Date: Sat, 9 Nov 2002 23:33:55 -0800 References: <1de67ce8.-1@WebX.la2eafNXanI> Lines: 39 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit