Application.AddNewColumn Method (Project)

Adds a new column in a specified position, in views where columns can be added.

Version Information

Version Added: Project 2010

Syntax

expression .AddNewColumn(Column)

expression An expression that returns an Application object.

Parameters

Name

Required/Optional

Data Type

Description

Column

Optional

Variant

Specifies the absolute column location. A value of 0 adds a column in the left-most position.

Return Value

Boolean

Remarks

If the Column parameter is omitted, AddNewColumn inserts a column to the left of the active column, and shows [Type Column Name] in the column heading. By comparison, the ColumnInsert method brings up the Field Settings dialog box for the new column.

Example

The following example selects the third column in the current view, and then adds a column to the right of the selected column. In the default Gantt Chart view, the third column is Task Name.

SelectColumn (2) 
AddNewColumn (3)

Note

If the user does not name the column header, removes the column. The column does not exist until the field is named. If you try to use the ColumnEdit method after AddNewColumn, Project shows run-time error 1100.