Adobe 26001360 Scripting Guide - Page 382
Example 46.1, Table 5.87, ParagrahStyle- Methods
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 382 highlights
382 Visual Basic Reference Table 5.87 ParagrahStyle- Methods Method ApplyTo(textframe ,[ClearingOverrides as Boolean]) Delete() Returns Nothing What it does Apply the paragraph style to text object(s) Delete the object Example 46.1 ' ParagraphStyles ' ' Create 3 simple paragraphs with different attributes ' Create a ParagraphStyle and apply it to each paragraph ' Dim appRef As New Illustrator.Application Dim docRef As Illustrator.Document Dim pathRef As Illustrator.PathItem Dim textRef As Illustrator.TextFrame ' Create 3 new pararagraphs Set docRef = appRef.Documents.Add() Set pathRef = docRef.PathItems.Rectangle(600, 200, 200, 400) Set textRef = docRef.TextFrames.AreaText(pathRef) textRef.Paragraphs.Add ("Left justified paragraph.") textRef.Paragraphs.Add ("Center justified paragraph.") textRef.Paragraphs.Add ("Right justified paragraph.") textRef.TextRange.CharacterAttributes.Size = 28 ' Change the justification of each paragraph ' using the paragraph attributes object textRef.Paragraphs(1).ParagraphAttributes.Justification = aiRight textRef.Paragraphs(2).ParagraphAttributes.Justification = aiCenter textRef.Paragraphs(3).ParagraphAttributes.Justification = aiLeft ' create a new paragraph style MsgBox "Creating and applying a paragraph style" Dim paraStyle As Illustrator.ParagraphStyle Set paraStyle = docRef.ParagraphStyles.Add("LeftIndent") ' add some paragraph attributes paraStyle.ParagraphAttributes.Justification = aiLeft paraStyle.ParagraphAttributes.FirstLineIndent = 10 Dim pg For Each pg In textRef.Paragraphs paraStyle.ApplyTo pg, True Next pg appRef.Redraw 12 Aug 03