title | ms.service | ms.assetid | ms.date | ms.localizationpriority |
---|---|---|---|---|
Resources object (Project) |
project-server |
84f8357a-358b-f2ae-e164-65c0c5abd383 |
06/08/2017 |
medium |
Contains a collection of Resource objects.
Using the Resources Collection
Use Resources (index), where index is the resource index number or resource name, to return a single Resource object. The following example lists the names of all resources in the active project.
Dim R As Long, Names As String
For R = 1 To ActiveProject.Resources.Count
Names = ActiveProject.Resources(R).Name & ", " & Names
Next R
Names = Left$(Names, Len(Names) - Len(ListSeparator & " "))
MsgBox Names
Using the Resources Collection
Use the Resources property to return a Resources collection. The following example generates the same list as the previous example, but does so by setting an object reference to ActiveProject.Resources
, and then using R
where ActiveProject.Resources
is used.
Dim R As Resources, Temp As Long, Names As String
Set R = ActiveProject.Resources
For Temp = 1 To R.Count
Names = R(Temp).Name & ", " & Names
Next Temp
Names = Left$(Names, Len(Names) - Len(ListSeparator & " "))
MsgBox Names
Use the Add method to add a Resource object to the Resources collection. The following example adds a new resource named Matilda to the active project.
ActiveProject.Resources.Add "Matilda"
Name |
---|
Add |
Name |
---|
Application |
Count |
Item |
Parent |
UniqueID |
[!includeSupport and feedback]