Article View: adobe.scripting.indesign
Article #16758Re: [VB] Alteration on Paragraph.TextContents isn't reflected in object model
From: Olav Kvern
Date: Thu, 31 Jul 2003 16:26
Date: Thu, 31 Jul 2003 16:26
25 lines
1764 bytes
1764 bytes
Jens--
There's always this approach, which avoids the problem altogether:
Dim myInDesign As InDesign.Application
Set myInDesign = CreateObject("InDesign.Application.2.0")
Set myDocument = myInDesign.Documents.Add
Set myTextFrame = myDocument.Pages.Item(1).TextFrames.Add
myTextFrame.ParentStory.TextContents = "paragraph 1" & vbCr & "paragraph 2" & vbCr & "paragraph 3"
myTextFrame.GeometricBounds = Array("6p", "6p", "24p", "24p")
Set myParagraph = myTextFrame.ParentStory.Paragraphs.Item(2)
MsgBox ("Paragraph contains: " & myTextFrame.ParentStory.Paragraphs.Item(2).TextContents)
myParagraph.InsertionPoints.Item(1).TextContents = "This is "
MsgBox ("Paragraph contains: " & myTextFrame.ParentStory.Paragraphs.Item(2).TextContents)
I'm really not sure about whether this behavior is expected or not. I'll have to think about it for a bit.<g>
Thanks,
Ole
Technical Details
Message-ID:
<1dea2438.4@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!diablo.voicenet.com!in.100proofnews.com!in.100proofnews.com!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<370F0F6BE5E413811BC789EAB1A3127D@in.WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,1423a92aa3a5942 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-07-31 09:38:09 PST From: "Olav Kvern" <okvern@adobe.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!diablo.voicenet.com!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] Alteration on Paragraph.TextContents isn't reflected in object model Message-ID: <1dea2438.4@WebX.la2eafNXanI> Date: Thu, 31 Jul 2003 09:26:39 -0700 References: <370F0F6BE5E413811BC789EAB1A3127D@in.WebX.la2eafNXanI> Lines: 25 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit