Article View: adobe.scripting.indesign
Article #16344Re: [VB] Working with GeometricBounds
From: Olav Kvern
Date: Thu, 25 Sep 2003 19:29
Date: Thu, 25 Sep 2003 19:29
28 lines
1717 bytes
1717 bytes
Guy-- Try: 'Get the dimensions of the page (given a document "myDocument") myPageWidth = myDocument.DocumentPreferences.PageWidth myPageHeight = myDocument.DocumentPreferences.PageHeight 'Get the Margins of the page MarginB=myPage.MarginPreferences.MarginBottom MarginL=myPage.MarginPreferences.MarginLeft MarginR=myPage.MarginPreferences.MarginRight 'Get the bounds of my TextFrame myBounds = DocCDN.GeometricBounds myFrameHeight = myBounds(2)-myBounds(0) myBounds(0) = MarginB - myFrameHeight myBounds(1) = MarginL myBounds(2) = MarginB myBounds(3) = myPageWidth - MarginR DocCDN.GeometricBounds = myBounds Does that do what you want? I'm assuming that the height of the frame is what you want it to be before you start this process. Also, if you ever need to convert from a Variant to a specific type, use a conversion--CDbl(Variant), for example, will convert the Variant to a Double. Thanks, Ole
Technical Details
Message-ID:
<2ccd88b5.11@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeeds.sol.net!news.maxwell.syr.edu!in.100proofnews.com!in.100proofnews.com!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2ccd88b5.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,34141f6e382b2aea X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-09-25 12:38:14 PST From: "Olav Kvern" <okvern@adobe.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeeds.sol.net!news.maxwell.syr.edu!in.100proofnews.com!in.100proofnews.com!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: [VB] Working with GeometricBounds Message-ID: <2ccd88b5.11@webx.la2eafNXanI> Date: Thu, 25 Sep 2003 12:29:49 -0700 References: <2ccd88b5.-1@webx.la2eafNXanI> Lines: 28 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit