Article View: adobe.scripting.indesign
Article #19969Re: How to add a newline to a textframe?
From: roberto soto
Date: Fri, 08 Nov 2002 18:04
Date: Fri, 08 Nov 2002 18:04
21 lines
1616 bytes
1616 bytes
HI Pieter,
I dont know where inside the textframe you want to add the line, let see if this help you?
This example add the new line at the end.
You also can count how many lines you have and insert after(before) any given line
Set myInDesign = CreateObject("InDesign.Application.2.0")
Rem Create the Document
Set myDocument = myInDesign.Documents.Add
Set myDocPage = myDocument.Pages.Item(1)
Set myTextFrame = myDocPage.TextFrames.Add
myTextFrame.GeometricBounds = Array("2p", "2p", "7p", "17p6")
Rem Add The Text
myTextFrame.TextContents = "This is the first line" & vbCr
Rem Calculate the last insertion point to add the text at the end
myIndex = myTextFrame.InsertionPoints.Count
myTextFrame.InsertionPoints.Item(myIndex).TextContents = "This is another line" & vbCr
Roberto
Technical Details
Message-ID:
<1de682e2.0@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de682e2.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,ab104dab91aa7fb2 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-11-08 10:12:03 PST From: "roberto soto" <roberto1soto@hotmail.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.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: How to add a newline to a textframe? Message-ID: <1de682e2.0@WebX.la2eafNXanI> Date: Fri, 8 Nov 2002 10:04:48 -0800 References: <1de682e2.-1@WebX.la2eafNXanI> Lines: 24 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit