Share via


Subprojects Collection Object

Project Developer Reference

Contains a collection of Subproject objects

Example

Using the Subprojects Collection Object

Use Subprojects(Index), where Index is the subproject index or project summary task name, to return a single Subproject object. The following example prevents changes made to the specified subproject in a master project from being automatically made to the source project.

Visual Basic for Applications
  ActiveProject.Subprojects("Arcadia Bay Online Catalog Plan").LinkToSource = False

Getting the Subprojects Collection object

Use the Subprojects property to return a Subprojects collection. The following example cautions the user if any of the subprojects in the active project are not on the hard disk.

Visual Basic for Applications
  Dim SubProj As Subproject

For Each SubProj in ActiveProject.Subprojects If UCase(Left$(SubProj.Path, 1)) <> "C" Then MsgBox Right$(SubProj.Path, InStrRev(SubProj.Path, "") - 1) & _ " is not on your local hard disk.", vbExclamation End If Next SubProj

See Also