Previous Document Next Document
TextRange.InRange

Function InRange(Range As TextRange) As Boolean

Member of TextRange

The InRange method returns whether the current text range is within the specified range.

Parameters
Description
Range
Specifies the range

The following code example displays whether the second word is in the first frame:

Sub Test() 
 Dim t As Text 
 Dim s As Shape 
 Dim d As Document 
 Set d = CreateDocument 
 Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, _ 
  "This is an example") 
 Set t = s.Text 
 If t.Story.Words(2).InRange(t.Frames(1).Range) Then 
  MsgBox "The second word is in the first frame." 
 Else 
  MsgBox "The second word is not in the first frame." 
 End If 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.