Previous Document Next Document
TextRange.SetRange

Sub SetRange(Start As Long, End As Long)

Member of TextRange

The SetRange method sets the starting and ending positions of the text range.

Parameters
Description
Start
Specifies the starting position
End
Specifies the ending position

The following code example underlines the text range that includes the third-to-tenth characters:

Sub Test() 
 Dim s As Shape 
 Dim tr As TextRange 
 Dim d As Document  
 Set d = CreateDocument 
 Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, _ 
  "This is an example") 
 Set tr = s.Text.Story 
 tr.SetRange 3, 10 
 tr.Underline = cdrDoubleThinFontLine  
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.