ConsolidateProjects Method

Displays the data from one or more projects in a single window.

Syntax

expression**.ConsolidateProjects(Filenames, NewWindow, AttachToSources, PoolResources, HideSubtasks, openPool, UserID, Password)**

*expression   *     Optional. An expression that returns an Application object.

Filenames    Optional String. One or more file names of projects to consolidate.

NewWindow    Optional Boolean. True if projects are inserted (consolidated) into a new project. False if projects are inserted into the active project at the selection point. The default value is False.

AttachToSources    Optional Boolean. True if changes in the consolidated project affect source projects. The default value is True.

PoolResources    Due to changes in the object model of Microsoft Office Project 2003, this argument is ignored. It is retained so that existing macros which make use of this argument do not cause errors.

HideSubtasks    Optional Boolean. True if the subtasks of the projects specified with Filenames are hidden. The default value is True.

openPool    Optional Long. The action to take when opening a resource pool or sharer file. When opening a master project, the value for this argument is also applied to the subprojects. Can be one of the following PjPoolOpen constants: pjDoNotOpenPool, pjPoolAndSharers, pjPoolReadOnly, pjPoolReadWrite, or pjPromptPool. The default value is pjPromptPool.

UserID    Optional String. A user ID to use when accessing a project in a database. If Filenames does not refer to a database, UserID is ignored.

Password    Optional String. A password to use when opening password-protected project files. If Password is incorrect or omitted and a file requires a password, the user is prompted for the password.

Remarks

To specify that a consolidated project should be inserted as read-only, type (R/O) at the end of the file name in Filenames.

If the ConsolidateProjects method is used without specifying any arguments, the Insert Project dialog box appears.

Example

The following example creates a consolidated project, prints a report, and closes the consolidated project without saving it.

Sub ConsolidatedReport()
    ConsolidateProjects Filenames:="Project1.mpp" & ListSeparator & "Project2.mpp", NewWindow:=True
    ReportPrint Name:="Critical Tasks"
    FileClose Save:=pjDoNotSave
End Sub

Applies to | Application Object

See Also | WindowNewWindow Method