Previous Document Next Document

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


TextFrame.ColumnCount

Property ColumnCount As Long

Description

Member of TextFrame

The ColumnCount property returns the number of columns in a paragraph-text frame.

The ColumnCount property returns a read-only value.

VBA example

The following VBA example links frames of paragraph text. It then creates three columns in the first frame, displaying the number of columns in the frame for each multicolumned frame.

Sub Test()
 Dim d As Document
 Dim s As Shape
 Dim s1 As Shape
 Dim s2 As Shape
 Dim t As Text
 Dim f As TextFrame
 Set d = CreateDocument
 Set s = d.ActiveLayer.CreateParagraphText(2, 2, 5, 5, String$(750, "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
 ' Get the first frame
 Set f = t.Frames(1)
 ' Set the columns
 f.SetColumns 3, False, Array(1, 0.3, 2, 0.3, 3)
 For Each f In t.Frames
  If f.Multicolumn Then
   MsgBox "There are " & f.ColumnCount & _
    " columns in frame " & f.Index
  End If
 Next f
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.