Application.ConsolidateProjects Method

Project Developer Reference

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

Syntax

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

expression   A variable that represents an Application object.

Parameters

Name Required/Optional Data Type Description
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 Optional Variant Due to changes in the object model of Microsoft Office Project 2007, this argument is ignored. It is retained so that existing macros that use 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. The default value is pjPromptPool.
UserID Optional Variant 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.

Return Value
Boolean

Remarks

To specify that a consolidated project should be inserted as read-only, append "(R/O)" to the file name in Filenames.

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

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

See Also