🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17338

Re: [VB] Find All Selected TextFrames in a Page

#17338
From: Olav Kvern
Date: Thu, 19 Jun 2003 17:19
35 lines
1924 bytes
Chris--

Actually, Selection now *always* returns an Array--in 1.5, it would return an array when multiple items were selected, but would return a single object when one object was selected.



Dim myInDesign As InDesign.Application 
Dim myArray As Variant 
ReDim myArray(0) 
Set myInDesign = CreateObject("InDesign.Application.2.0") 
If myInDesign.Documents.Count > 0 Then 
    If myInDesign.Selection.Count > 0 Then 
        For myCounter = 1 To myInDesign.Selection.Count 
            Select Case TypeName(myInDesign.Selection.Item(myCounter)) 
                Case "TextFrame" 
                    Rem Add the text frame to the array "myArray". 
                    If TypeName(myArray(0)) = "TextFrame" Then 
                        ReDim Preserve myArray(UBound(myArray) + 1) 
                    End If 
                    Set myArray(UBound(myArray)) = myInDesign.Selection.Item(myCounter) 
                Case Else 
                    Rem Do nothing 
            End Select 
        Next 
    End If 
End If 
Rem At this point, the array myArray holds all of the text frames that were 
Rem in the selection. Do with them what you will. 




Thanks,

Ole
Technical Details
Message-ID: <1de997f1.0@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de997f1.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,d7a626ee7b7d3e18
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-06-19 10:38:17 PST
From: "Olav Kvern" <okvern@adobe.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: [VB] Find All Selected TextFrames in a Page
Message-ID: <1de997f1.0@WebX.la2eafNXanI>
Date: Thu, 19 Jun 2003 10:19:51 -0700
References: <1de997f1.-1@WebX.la2eafNXanI>
Lines: 35
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit