Share via


Project.Activate Event

Project Developer Reference

Occurs when switching to the project from another project, including when the project is opened or created.

Syntax

expression.Activate(pj)

expression   A variable that represents a Project object.

Parameters

Name Required/Optional Data Type Description
pj Required Project The project that was activated.

Remarks

When you switch between two windows showing the same project, the Activate event for the project doesn't occur.

This event doesn't occur when you create a new window.

Microsoft Office Project 2007 events do not occur when the project is embedded in another document or application.

Example
The following example ensures that the project window is maximized whenever it is activated.

Visual Basic for Applications
  Private Sub Project_Activate(ByVal pj As MSProject.Project)
    pj.Windows.ActiveWindow.WindowState = pjMaximized
End Sub

See Also