Article View: adobe.scripting.indesign
Article #19757Re: VB6&ID - Replace function like ImportXML
From: David Ames
Date: Thu, 21 Nov 2002 01:04
Date: Thu, 21 Nov 2002 01:04
12 lines
2153 bytes
2153 bytes
Thanks for that... Your method works well. What I'm wanting to do is maintain the image containers attributes (size, scaling, etc, etc) and simply replace the image within.
I'm looping through my pageItems collection as so:
For curPageItem = 1 To idPage.PageItems.Count
If idPage.PageItems(curPageItem).ContentType = idGraphic Then
and i've noticed that when curPageItem = 11 then I get a runtime error on the second line... "Object doesn't support this property or method". It's almost like this page item does not have a ContentType at all. (as apposed to an Unassigned ContentType) idPage.PageItems.Count = 19 so it's not like i'm exceeding the array's bounds...
Anyway apart from the above RunTime error, i'm able to replace images.... Replacing Text is the next step (I want to keep the TextFrame's formattin the same, only change the text within...... I can see objects like the TextFrame object of the PageItem, so I'm assuming that's where I start, but am I trying to replace a story, a paragraph, or a text...
Some kind of graphical representation of the ID object model would be nice (i'm making do with the VB object browser and the idsnscripting.pdf doco) - but i'm guessing it would be messy because of the there does not appear to any read hiarachy to objects in ID... IE, I can iterate through all Links in a document, OR all Links in an image object...
Technical Details
Message-ID:
<1de6b092.1@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-01!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:
<1de6b092.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,9fb81744ad733cf6 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-11-20 17:07:44 PST From: "David Ames" <davida@in-site.com.au> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-01!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: VB6&ID - Replace function like ImportXML Message-ID: <1de6b092.1@WebX.la2eafNXanI> Date: Wed, 20 Nov 2002 17:04:23 -0800 References: <1de6b092.-1@WebX.la2eafNXanI> Lines: 26 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit