API Documentation > CorelDRAW > 2025-v26 > TextRange > IVGTextRange
TextRange.InRange method
Gets whether the current text range is within the given range
Syntax:
Function InRange(ByVal Range As TextRange) As Boolean
Parameters:
Name Type Description
Range
Remarks:
The InRange method returns whether the current text range is within a specified range.
Examples:
The following VBA 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