Previous Document Next Document
TextRange.Paste

Function Paste() As TextRange

Member of TextRange

The Paste method replaces a text range and returns the new one.

The following code 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 2007 Corel Corporation. All rights reserved.