Previous Document Next Document

Object Model Reference : Classes : T : TextFrame : Methods : TextFrame.SetColumns


TextFrame.SetColumns

Sub SetColumns(NumColumns As Long, EqualColumns As Boolean, WidthsAndGutters() As Variant)

Description

Member of TextFrame

The SetColumns property creates columns within a paragraph-text frame.

Parameter
Description
NumColumns
Specifies the number of columns
EqualColumns
Specifies whether the columns are equal in width
WidthsAndGutters
Specifies the sizes of the column and gutter, respectively, for each column and gutter

VBA example 1

The following VBA example links frames of paragraph text. In the first frame, and by using an array, it creates three columns of varying widths and equal spacing.

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)
End Sub
VBA example 2

The following VBA example links frames of paragraph text. In the first frame, it creates three columns of equal width and spacing.

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
 Set f = t.Frames(1)
 ' Set the columns.
 f.SetColumns 3, True, Array(1, 0.3)
End Sub
VBA example 3

The following VBA example links frames of paragraph text. In the first frame, and without using an array, it creates four columns of varying widths.

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 frames together.
 t.Frame.LinkTo s1
 s1.Text.Frame.LinkTo s2
 Set f = t.Frames(1)
 ' Set the columns.
 f.SetColumns 4, False, 1, 0.3, 1, 0.2, 0.5, 0.1, 0.4
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.