Article View: adobe.scripting.indesign
Article #15096Re: [VB] Insert "End Nested Style Here" Character?
From: Olav_Kvern
Date: Tue, 16 Dec 2003 23:23
Date: Tue, 16 Dec 2003 23:23
35 lines
1884 bytes
1884 bytes
Brian--
Here's a quick example:
Rem NestedStyleExample.vbs
Set myInDesign = CreateObject("InDesign.Application.CS")
Rem Create an example document
Set myDocument = myInDesign.Documents.Add
Set myColor = myDocument.Colors.Add
myColor.Model = idColorModel.idProcess
myColor.Space = idColorSpace.idCMYK
myColor.ColorValue = Array(0, 100, 80, 0)
myColor.Name = "Red"
Set myCharacterStyle = myDocument.CharacterStyles.Add
myCharacterStyle.Name = "Nested Style"
myCharacterStyle.FillColor = "Red"
Set myTextFrame = myDocument.Pages.Item(1).TextFrames.Add
myTextFrame.GeometricBounds = Array("6p", "6p", "24p", "24p")
myTextFrame.Contents = "Note: This is a run-in heading formatted using a nested style."
Set myParagraphStyle = myDocument.ParagraphStyles.Add
myParagraphStyle.Name = "RunInHead"
Set myNestedStyle = myParagraphStyle.NestedStyles.Add
myNestedStyle.AppliedCharacterStyle = myCharacterStyle
Rem The delimiter sets the end of the rang.e
myNestedStyle.Delimiter = ":"
myNestedStyle.Inclusive = True
myTextFrame.Texts.Item(1).AppliedParagraphStyle = myParagraphStyle
Hope this helps!
Thanks,
Ole
Technical Details
Message-ID:
<2ccef5d8.0@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2ccef5d8.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,ae75b0afe6278d8d X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-12-16 15:37:50 PST From: Olav_Kvern@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: [VB] Insert "End Nested Style Here" Character? Message-ID: <2ccef5d8.0@webx.la2eafNXanI> Date: Tue, 16 Dec 2003 15:23:33 -0800 References: <2ccef5d8.-1@webx.la2eafNXanI> Lines: 34 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit