🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #19928

Re: Creating tables on the fly, Windows InDesign

#19928
From: GeekGod
Date: Thu, 14 Nov 2002 20:35
30 lines
1911 bytes
Okay, here is the code I am trying. 

Should be simple enough... 

Set findstyle = mydocument.CharStyles.Item(CharacterStyle) 
    ' clear out existing data 
    MyIndesign.FindPreferences = idNothing 
    ' setup find style 
    MyIndesign.FindPreferences.CharacterStyle = findstyle 
    ' clear out existing data 
    MyIndesign.ChangePreferences = idNothing 
    ' get a collection of text objects that have that style applied 
    MyIndesign.ChangePreferences.CharacterStyle = findstyle 
    'Set foundtext = mydocument.Search("", , , "") 
    Set FoundText = mydocument.Search 
    ' do something to FoundText.Item(X), like: 
    If IsObject(FoundText) = False Then Exit Sub 
    Dim xxx As Long 
    FoundText.Items(1).Tables.Add 
    'For xxx = FoundText.Count To 1 Step -1 
    ' Set Item = FoundText.Item(xxx) 
    ' 'If Item.Name = CharacterStyle Then 
    ' Item.Tables.Add 
    ' 'Exit For 
    ' 'End If 
    'Next 

If I try to iterate through with the for loop or to try to add a table as noted above, I get object doesnt support this method... 

How would I get an insertion point right before this task (adding a table)?
Technical Details
Message-ID: <1de68f3a.10@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-05!sn-xit-06!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
References: <1de68f3a.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,734b037c90d04195
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2002-11-14 12:50:08 PST
From: GeekGod <geekgod@geekgod.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-05!sn-xit-06!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: Creating tables on the fly, Windows InDesign
Message-ID: <1de68f3a.10@WebX.la2eafNXanI>
Date: Thu, 14 Nov 2002 12:35:57 -0800
References: <1de68f3a.-1@WebX.la2eafNXanI>
Lines: 32
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit