Article View: adobe.scripting.indesign
Article #17281Re: How to map a character style to inline tagged text? (VB)
From: roberto soto
Date: Mon, 23 Jun 2003 15:51
Date: Mon, 23 Jun 2003 15:51
31 lines
1877 bytes
1877 bytes
Hi Linda,
Message before have some error because of use of tags
Set myInDesign = CreateObject("InDesign.Application.2.0")
Set myDocument = myInDesign.ActiveDocument
' Put a text frame with a text:
' This is bold and this is also prueba bold.
Set myFrame = myDocument.TextFrames.Item(1)
Set myStory = myFrame.ParentStory
'Ignore extra space inside <>
Set myStart = myStory.Search("< b>")
Set myEnd = myStory.Search("< /b>")
' Your document need to have a character style "bold"
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
'Ignore extra space inside <>
Set myS = myStory.Search("< b>", , , vbNullChar)
Set myS = myStory.Search("< /b>", , , vbNullChar)
Thanks,
Roberto
Technical Details
Message-ID:
<1de9a510.2@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!216.170.153.135.MISMATCH!tdsnet-transit!newspeer.tds.net!cyclone.bc.net!logbridge.uoregon.edu!xmission!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de9a510.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,650e9dfce3d43e1b X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-06-23 09:07:56 PST From: "roberto soto" <roberto1soto@hotmail.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!216.170.153.135.MISMATCH!tdsnet-transit!newspeer.tds.net!cyclone.bc.net!logbridge.uoregon.edu!xmission!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: How to map a character style to inline tagged text? (VB) Message-ID: <1de9a510.2@WebX.la2eafNXanI> Date: Mon, 23 Jun 2003 08:51:34 -0700 References: <1de9a510.-1@WebX.la2eafNXanI> Lines: 34 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit