Columns.Add method (Publisher)

Adds a new Column object to the specified Columns collection and returns the new Column object.

Syntax

expression.Add (BeforeColumn)

expression A variable that represents a Columns object.

Parameters

Name Required/Optional Data type Description
BeforeColumn Optional Long The number of the column before which to insert the new column. If this argument is omitted, the new column is added after the existing columns. An error occurs if the value of this argument does not correspond to an existing column in the table.

Return value

Column

Example

The following example adds a column before column three in the specified table.

Dim colNew As Column 
 
Set colNew = ActiveDocument.Pages(1).Shapes(1) _ 
 .Table.Columns.Add(BeforeColumn:=3)

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.