Table.TableFields property (Project)

Gets a TableFields collection representing the fields in the table. Read-only TableFields.

Syntax

expression. TableFields

expression A variable that represents a Table object.

Example

The following example changes the alignment of a column in an entry table. The macro asks for input from the user to indicate which column the user wants to center, then changes the display and refreshes the view.

Sub AutoWrap() 
 Dim fieldNumber As Integer 
 
 fieldNumber = InputBox$(Prompt:="Enter the number of the " _ 
 & "column you want to center in the Entry table." _ 
 & Chr(13) & "For example, Column 1 is the Indicators " _ 
 & "column.") 
 
 ActiveProject.TaskTables("Entry").TableFields(fieldNumber _ 
 + 1).AlignData = pjCenter 
 
 TableApply Name:="&Entry" 
End Sub

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.