Previous Document Next Document
TextCharacters.Item

Property Item(Index As Long, [Count As Long = 1]) As TextRange

Member of TextCharacters

The Item property returns a TextRange object that contains the specified characters.

The Item property returns a read-only value.

Parameters
Description
Index
Specifies the index number of the character
Count
Specifies the number of characters to include
This parameter is optional, and its default value is 1.

The following code example creates paragraph text, applies bold formatting to the third character, and fills the tenth-to-fifteenth characters with red:

Sub Test() 
 Dim d As Document 
 Dim s As Shape 
 Dim t As Text 
 Dim strText As String 
 Set d = CreateDocument 
 Set s = d.ActiveLayer.CreateParagraphText(2, 2, 8, 8, "This is a 
test.") 
 Set t = s.Text 
 t.Story.Characters.Item(3).Bold = True 
 t.Story.Characters.Item(10, 5).Fill.UniformColor.RGBAssign 155, 0, 
0 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.