Previous Document Next Document

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


TextRange.Copy

Sub Copy()

Description

Member of TextRange

The Copy method copies a text range to the Clipboard.

VBA example

The following VBA example creates paragraph text, applies bold formatting to the fourth and fifth words, and italicizes the first word. It then copies the text range and pastes it in the second paragraph.

Sub Test()
 Dim d As Document
 Dim s As Shape
 Dim s1 As Shape
 Dim t As Text
 Set d = CreateDocument
 Set s = d.ActiveLayer.CreateParagraphText(3, 3, 5, 5, _
  "This is an example.")
 Set s1 = d.ActiveLayer.CreateParagraphText(7, 7, 9, 9)
 Set t = s.Text
 t.Story.Words(4, 2).Bold = True
 t.Story.Words(1).Italic = True
 t.Story.Copy
 s1.Text.Story.Paste
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.