Previous Document Next Document
TextRange.Combine

Sub Combine(Range As TextRange)

Member of TextRange

The Combine method combines the current text range with the specified range.

Parameters
Description
Range
Specifies the range to be combined

The following code example stores the fourth word and the second line in separate text ranges. It duplicates the fourth word and combines it with the text range for the second line. Bold formatting is applied to the fourth word, and the second line is underlined. The combined text range is then filled with red.

Sub Test() 
 Dim t As Text 
 Dim s As Shape 
 Dim trLine As TextRange 
 Dim trWord As TextRange 
 Dim tr As TextRange 
 Dim d As Document 
 Set d = CreateDocument 
 Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, _ 
  "This is a line 1." & vbCr & "This is line 2.") 
 Set t = s.Text 
 Set trWord = t.Story.Words(4) 
 Set trLine = t.Story.Lines(2) 
 Set tr = trWord.Duplicate 
 tr.Combine trLine 
 trWord.Bold = True 
 trLine.Underline = cdrSingleThickFontLine 
 tr.Fill.UniformColor.RGBAssign 155, 0, 0  
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.