Share via


Understanding the Project Application Object

The Application object is the top of the hierarchy. All Microsoft® Project objects are accessed through the Application object. Application object methods represent the common command functionality of the user interface. These methods are used for the basic Project commands. The Application object is the parent of the Cell, Project, Selection, and Window objects, as well as the Projects and Windows collections.

For example, to open a new project from a template file:

Sub Tester() 
Application.FileOpen Name:="LANSUB.MPT" 
End Sub 

Using the Application object to refer to Project objects is optional when writing macros. This returns the same result as the previous example:

Sub Tester() 
FileOpen Name:="LANSUB.MPT" 
End Sub 

To move the active cell, use one of the following options, SelectCellDown, SelectCellRight, SelectCellLeft, SelectCellUp, or SelectColumn.

Sub Tester() 
For I = 1 To 10 
SelectCellRight I 
SelectCellDown I 
SelectCellLeft I 
SelectCellUp I 
Next I 
SelectColumn 
End Sub 

Application object properties describe the Project environment. These properties are used to manage settings in the Options and Leveling dialog boxes. Although not all properties are editable, many are:

Sub TitleBarExample() 
MsgBox Application.ActiveWindow 
Application.ActiveWindow.Caption = "CPM is Cool" 
End Sub 

See Also

Working with Microsoft Project Objects | Understanding the Project Object Model