Previous Document Next Document

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


TextRange.Duplicate

Function Duplicate() As TextRange

Description

Member of TextRange

The Duplicate method returns a copy of a text range.

VBA example

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.