API Documentation > CorelDRAW > 2025-v26 > TextRange > IVGTextRange
TextRange.Duplicate method
Returns a copy of the TextRange object
Syntax:
Function Duplicate() As TextRange
Remarks:
The Duplicate method returns a copy of a text range.
Examples:
The following VBA example duplicates the first five characters of the paragraph and displays them in a message box.
Sub Test()
Dim d As Document
Dim t As Text
Dim s As Shape
Dim tr As TextRange
Set d = CreateDocument
Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, "This is an example.")
Set t = s.Text
Set tr = t.Story.Characters(1, 5).Duplicate
MsgBox "The text that is duplicated is: " & vbCr & tr.Text 
End Sub