Article View: adobe.scripting.indesign
Article #21069Re: Paragraph Style Change (ID2)
From: Olav Kvern
Date: Tue, 14 May 2002 14:38
Date: Tue, 14 May 2002 14:38
11 lines
1744 bytes
1744 bytes
Stuart--
In that case, you'll get a big speed improvement if you use the Search method (which is attached to all text objects, stories, text frames, and documents). What you want to do is search for a given style and replace it with another style. Something like this:
Rem Replace paragraph style "style_1" with "style_2" Dim myInDesign As InDesign.Application Set myInDesign = CreateObject("InDesign.Application.2.0") Set myDocument = myInDesign.ActiveDocument Rem Clear the current find/change preferences myInDesign.FindPreferences = idNothing myInDesign.ChangePreferences = idNothing Rem Set the style you want to find myInDesign.FindPreferences.ParagraphStyle = myDocument.ParaStyles.Item("style_1") Rem Set the style you want to find myInDesign.ChangePreferences.ParagraphStyle = myDocument.ParaStyles.Item("style_2") myDocument.Search "", False, False, ""
Does that work for you?
Thanks,
Ole
Technical Details
Message-ID:
<ef85fa3.10@WebX.aaQKaf7vad4>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!peer1-sjc1.usenetserver.com!usenetserver.com!news.tele.dk!small.news.tele.dk!194.213.69.151!news.algonet.se!algonet!news000.worldonline.se!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<ef85fa3.-1@WebX.aaQKaf7vad4>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,707bbb6c485c43a7 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-05-14 08:08:20 PST From: "Olav Kvern" <okvern@adobe.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!peer1-sjc1.usenetserver.com!usenetserver.com!news.tele.dk!small.news.tele.dk!194.213.69.151!news.algonet.se!algonet!news000.worldonline.se!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Paragraph Style Change (ID2) Message-ID: <ef85fa3.10@WebX.aaQKaf7vad4> Date: Tue, 14 May 2002 07:38:15 -0700 References: <ef85fa3.-1@WebX.aaQKaf7vad4> Lines: 28 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit