🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #16614

Re: [VB] Selecting and making text bold.

#16614
From: roberto soto
Date: Tue, 19 Aug 2003 12:18
28 lines
1736 bytes
Hi Holt,

try this after created a character style "bold" in InD

Rem sample 'This is bold<D> and this is also prueba bold.

Set myInDesign = CreateObject("InDesign.Application.2.0")
    Set myDocument = myInDesign.ActiveDocument
    Set myFrame = myDocument.TextFrames.Item(1)

Set myStory = myFrame.ParentStory

Set myStart = myStory.Search("")
    Set myEnd = myStory.Search("<D>")

For i = 1 To myStart.Count
                s = myStart.Item(i).Index
                e = myEnd.Item(i).Index
                Set myRange = myStory.Characters.ItemByRange(myStory.Characters.Item(s + 3), _
                                            myStory.Characters.Item(e - 1)).Item(1)
                myRange.CharacterStyle = myDocument.CharStyles.Item("bold")
    Next i

Set myS = myStory.Search("", , , vbNullChar)
    Set myS = myStory.Search("<D>", , , vbNullChar)

Thx, Roberto
roberto1soto@yahoo.com
Technical Details
Message-ID: <1dea3eff.3@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!t-online.de!webx
References: <1dea3eff.-1@webx.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,cee1bfff47b97ef0
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-08-19 05:40:06 PST
From: "roberto soto" <roberto1soto@hotmail.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.scripting.indesign
Subject: Re: [VB] Selecting and making text bold.
Message-ID: <1dea3eff.3@webx.la2eafNXanI>
Date: Tue, 19 Aug 2003 05:18:37 -0700
References: <1dea3eff.-1@webx.la2eafNXanI>
Lines: 31
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit