Adobe 26001360 Scripting Guide - Page 470
Words, Example 91.1
UPC - 718659321840
View all Adobe 26001360 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 470 highlights
470 Words A collection of words. Table 5.180 Words - Properties Property R/O Value type Application R/O Application Count Parent R/O Long R/O Object Visual Basic Reference What it is Application to which the collection belongs Number of elements in the collection True object's container Table 5.181 Words - Methods Method Add(Contents As String [,RelativeOject] [,InsertionLocation]) AddBefore(Contents As String) Index(ItemPtr As TextRange) Item(ItemKey) RemoveAll() Returns TextRange TextRange Long TextRange Nothing What it does Creates a word Insert text at the beginning of the range Returns the index position of the object within the collection Returns an object reference to the object identified by itemKey; by name or index Deletes all objects in this collection Example 91.1 This script displays the total number of words contained in all of the TextFrameItems in the current document. Dim appRef As New Illustrator.Application Dim numWords As Integer Dim textArt As Illustrator.TextFrame Dim textArtRange As Illustrator.TextRange If appRef.Documents.Count > 0 Then numWords = 0 For Each textArt In appRef.ActiveDocument.TextFrames numWords = numWords + textArt.TextRange.Words.Count Next MsgBox ("There are " & numWords & " words in the document.") 12 Aug 03