Application.TableEdit Method
Project Developer Reference |
Creates, edits, or copies a table.
Syntax
expression.TableEdit(Name, TaskTable, Create, OverwriteExisting, NewName, FieldName, NewFieldName, Title, Width, Align, ShowInMenu, LockFirstColumn, DateFormat, RowHeight, ColumnPosition, AlignTitle, HeaderAutoRowHeightAdjustment, HeaderTextWrap)
expression A variable that represents an Application object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Name | Required | String | The name of a table to edit, create, or copy. |
TaskTable | Required | Boolean | True if the active table contains information about tasks or resources. |
Create | Optional | Boolean | True if Project should create a new table. If NewName is Empty, the new table is given the name specified with Name. Otherwise, the new table is a copy of the table specified with Name and is given the name specified with NewName. The default value is False. |
OverwriteExisting | Optional | Boolean | True if an existing table should be overwritten with a new one. The default value is False. |
NewName | Optional | String | A new name for the existing table (Create is False) or new table (Create is True). If NewName is Empty and Create is False, the table specified with Name retains its current name. The default value is Empty. |
FieldName | Optional | String | The name of a field to change. |
NewFieldName | Optional | String | The name of a new field. The field specified with NewFieldName replaces the field specified with FieldName. |
Title | Optional | String | The title for the field specified with FieldName. |
Width | Optional | Long | A number that specifies the width of the field specified with FieldName. The default value is 10 for new fields. |
Align | Optional | Long | A constant that specifies how to align the text in the field specified with FieldName. Can be one of the following PjAlignment constants: pjLeft, pjCenter, or pjRight. The default value is pjRight. |
ShowInMenu | Optional | Boolean | True if the table name appears in the Tables menu. (The Tables menu appears when you click Table on the View menu.) The default value is False. |
LockFirstColumn | Optional | Boolean | True if Project should lock or prevent changes to the first column of the table. The default value is False. |
DateFormat | Optional | Long | A constant that specifies the format for the date fields in the table. The default value is pjDateDefault. Can be one of the PjDateFormat constants. |
RowHeight | Optional | Integer | The height of the rows in the table. The default value is 1. |
ColumnPosition | Optional | Long | The number of the column to edit. (Columns are numbered from the left to right, starting with 0.) If a value for NewFieldName is specified, a new column is inserted in the table. If ColumnPosition is set to 0, the new field is inserted in the first column (LockFirstColumn is False) or the second column (LockFirstColumn is True) of the table. Set ColumnPosition to -1 to specify the last column of the table. The default value is -1. |
AlignTitle | Optional | Long | A constant that specifies the alignment of the column's title. Can be one of the following PjAlignment constants: pjLeft, pjCenter, or pjRight. The default value is pjCenter. |
HeaderAutoRowHeightAdjustment | Optional | Boolean | True if Project automatically adjusts the row height of the table. |
HeaderTextWrap | Optional | Boolean | True if Project wraps text in the header of the table. |
Return Value
Boolean
Remarks
Project sets the order of the items in a date format (such as years, months, and days) equal to the corresponding value in the Regional Settings icon (in Windows 98, Windows NT, or Windows Me), Regional Options icon (in Windows 2000), or Regional and Language Options icon (in Windows XP) of the Microsoft Windows Control Panel.
Example
The following example creates a new table based on the Task Usage table and adds it to the Table menu. It adds the Priority field as the second column with a title and width of 12, changes the default date format, and then makes the new table the active view.
Visual Basic for Applications |
---|
|
See Also