Previous Document Next Document

Object Model Reference : Classes : T : TextColumns : Properties : TextColumns.Item


TextColumns.Item

Property Item(Index As Long, [Count As Long = 1]) As TextRange

Description

Member of TextColumns

The Item property returns a read-only reference to a specified column in a TextColumns collection. It is the default property of the TextColumns class.

Parameter
Description
Index
Specifies the preset placeholder that uniquely identifies each column in the TextColumns collection
Count
Specifies the number of columns. This parameter is optional, and its default value is 1.

VBA example

The following VBA example links frames of paragraph text. It then creates three columns in the first frame, applying italics to the third column, strikethrough formatting to the second, and a red fill to the first.

Sub Test()
 Dim s As Shape
 Dim s1 As Shape
 Dim s2 As Shape
 Dim d As Document
 Dim t As Text
 Dim tr As TextRange
 Dim strText As String
 strText = "This is a test. This sentence must be long enough " & _
  "to span across multiple columns in this frame. I am sure " & _
  "that it will cross multiple columns now."
 strText = strText & " This is next part " & strText
 Set d = CreateDocument
 Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, strText)
 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 the columns
 t.Frame.SetColumns 3, False, Array(0.7, 0.1, 1, 0.1, 1)
 t.Frame.Range.Columns.Item(3).Italic = True
 t.Frame.Range.Columns.Item(2).Strikethru = cdrDoubleThinFontLine
 t.Frame.Range.Columns.Item(1).Fill.ApplyUniformFill CreateRGBColor(155, 0, 0)
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.