🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #19756

Re: VB6&ID - Replace function like ImportXML

#19756
From: Olav Kvern
Date: Thu, 21 Nov 2002 00:05
25 lines
1788 bytes
David-- 

First, ContentType won't necessarily tell you that the PageItem contains a graphic--empty PageItems can have a ContentType of idGraphic. So the trick is to see if PageItem.PageItems.Count is equal to 1. If it is, there's a good chance it contains a graphic (though it could be a group, a text frame, or another PageItem). 

If you're looking for images, specifically, then you can say: 



Rem Given a PageItem "myPageItem" 
If myPageItem.Images.Count > 0 Then 
Set myImage = myPageItem.Images.Item(1) 
Set myLink = myImage.Link 
set myNewLink = myLink.Relink("c:\myImage.tif") 
End If 




...but is "Relink" really what you want? Relink replaces the image with another image (it's poorly named). If what you want to do is refresh the link to the original image, use Update. 

The VB object browser, in my opinion, does a pretty good job of exposing the relationship between objects...or were you looking for a diagram? 

Thanks, 

Ole
Technical Details
Message-ID: <1de6b092.0@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-01!sn-xit-04!supernews.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <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 16:07:39 PST
From: "Olav Kvern" <okvern@adobe.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-01!sn-xit-04!supernews.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!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.0@WebX.la2eafNXanI>
Date: Wed, 20 Nov 2002 16:05:19 -0800
References: <1de6b092.-1@WebX.la2eafNXanI>
Lines: 28
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit