Adobe 26001360 - Illustrator CS - PC Manual page 382

Scripting guide
Hide thumbs Also See for 26001360 - Illustrator CS - PC:
Table of Contents

Advertisement

382
Table 5.87 ParagrahStyle— Methods
Method
ApplyTo(textframe
,[ClearingOverrides as Boolean])
Delete()
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
Returns
What it does
Apply the paragraph style to text object(s)
Nothing
Delete the object
12 Aug 03
Visual Basic Reference

Advertisement

Table of Contents
loading

This manual is also suitable for:

Illustrator cs

Table of Contents