Previous Document Next Document

Object Model Reference : Classes : T : TextFrame : Properties : TextFrame.Range


TextFrame.Range

Property Range As TextRange

Description

Member of TextFrame

The Range property returns a text range (or TextRange object) containing the text in a paragraph-text frame. It is the default property of the TextRange class.

The Range property returns a read-only value.

VBA example

The following VBA example links frames of paragraph text, applying bold formatting to all text in the first frame.

Sub Test()
 Dim s As Shape
 Dim s1 As Shape
 Dim s2 As Shape
 Dim t As Text
 Dim f As TextFrame
 Dim d As Document
 Set d = CreateDocument
 Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(1000, "Z"))
 Set s1 = d.ActiveLayer.CreateParagraphText(5, 5, 8, 8)
 Set s2 = d.ActiveLayer.CreateParagraphText(8, 8, 10, 10)
 Set t = s.Text
 ' Link the frames together
 t.Frame.LinkTo s1
 s1.Text.Frame.LinkTo s2
 Set f = t.Frames(1)
 f.Range.Bold = True
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.