Skip to content

Latest commit

 

History

History
59 lines (34 loc) · 1.76 KB

Project.Application.AddNewColumn.md

File metadata and controls

59 lines (34 loc) · 1.76 KB
title keywords f1_keywords ms.service api_name ms.assetid ms.date ms.localizationpriority
Application.AddNewColumn method (Project)
vbapj.chm710
vbapj.chm710
project-server
Project.Application.AddNewColumn
009071ad-b713-4252-ab1c-781d58620d8c
06/08/2017
medium

Application.AddNewColumn method (Project)

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

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 displays [Type Column Name] in the column heading. By comparison, the ColumnInsert method displays 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, AddNewColumn removes the selected column. When you add a column, it does not exist until the field is named. If you try to use the ColumnEdit method after AddNewColumn, Project shows run-time error 1100 (the command in the macro is not available in this situation).

[!includeSupport and feedback]