Previous Document Next Document

Object Model Reference : Classes : T : TextCharacters : Properties : TextCharacters.Item


TextCharacters.Item

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

Description

Member of TextCharacters

The Item property returns a text range (or TextRange object) containing the specified characters. It is the default property of the TextCharacters class.

The Item property returns a read-only value.

Parameter
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.

VBA example

The following VBA example creates paragraph text, applies bold formatting to its third character, and fills its 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 2013 Corel Corporation. All rights reserved.