Previous Document Next Document

Object Model Reference : Classes : T : TextRange : Methods : TextRange.SetRange


TextRange.SetRange

Sub SetRange(Start As Long, End As Long)

Description

Member of TextRange

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

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

VBA example

The following VBA 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 2013 Corel Corporation. All rights reserved.