Previous Document Next Document
Text.Range

Function Range(Start As Long, End As Long) As TextRange

Member of Text

The Range method returns a range of characters.

Parameters
Description
Start
Specifies the starting character in the range
End
Specifies the ending character in the range

The following code example creates an artistic-text object and displays the first-to-fifth characters in a message box. The ninth-to-fourteenth characters are capitalized.

Sub Test() 
 Dim t As Text 
 Dim s As Shape 
 Dim d As Document 
 Set d = CreateDocument 
 Set s = d.ActiveLayer.CreateArtisticText(4, 5, "This is a test.") 
 Set t = s.Text 
 MsgBox "The text between characters 1 and 5 is: " & vbCr & t.Range(1, 
5).Text 
 t.Range(9, 14).Case = cdrAllCapsFontCase 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.