Article View: adobe.scripting.indesign
Article #8950Re: VB Help - Automating frames and flow...
From: Ken_Krugh
Date: Thu, 21 Sep 2006 17:45
Date: Thu, 21 Sep 2006 17:45
52 lines
2155 bytes
2155 bytes
Figured it out - now if someone can help me figure out how to find out if there are master text frames!
'Dim inD As InDesign.Application
'Dim theDoc As InDesign.Document
'Dim thePg As InDesign.Page
'Dim theFrame As InDesign.TextFrame
'Dim newPg As InDesign.Page
'Dim NewFrame As InDesign.TextFrame
Set inD = CreateObject("InDesign.Application.CS2")
Set theDoc = inD.Documents(1)
Set thePg = theDoc.Pages.LastItem
Set theFrame = thePg.TextFrames.LastItem
'get the size we are going to make the text box
With theDoc
pgWidth = .DocumentPreferences.PageWidth
PgHeight = .DocumentPreferences.PageHeight
MgnBottom = .MarginPreferences.Bottom
MgnRight = .MarginPreferences.Right
theTop = .MarginPreferences.Top
theLeft = .MarginPreferences.Left
theBot = PgHeight - MgnBottom
theRight = pgWidth - MgnRight
End With
FrmBounds = Array(theTop, theLeft, theBot, theRight)
Do Until theFrame.Overflows = False 'keep going until there's no more text
theDoc.Pages.Add (idAtEnd)
Set newPg = theDoc.Pages.LastItem
If newPg Mod 2 <> 0 Then 'right hand page
FrmBounds = Array(theTop, theLeft + pgWidth, theBot, theRight + pgWidth)
Else
FrmBounds = Array(theTop, theLeft, theBot, theRight)
End If
With newPg
Set NewFrame = .TextFrames.Add("Layer 1")
NewFrame.GeometricBounds = FrmBounds 'works 1st time on LH page, breaks on next RH page
NewFrame.PreviousTextFrame = theFrame
End With
Set theFrame = newPg.TextFrames.LastItem
Loop
Technical Details
Message-ID:
<3bc1b9db.0@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!news.ecp.fr!news.germany.com!news.isoc.lu!webcrossingReferences:
<3bc1b9db.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,26055e7a19463a28 X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Ken_Krugh@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!news.ecp.fr!news.germany.com!news.isoc.lu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: VB Help - Automating frames and flow... Message-ID: <3bc1b9db.0@webcrossing.la2eafNXanI> Date: Thu, 21 Sep 2006 10:45:35 -0700 References: <3bc1b9db.-1@webcrossing.la2eafNXanI> Lines: 55 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit