Share via


Availability Object, Availabilities Collection Object

Resource
Availabilities
Availability

Represents a line from the Resource Availability grid for a resource. The Availability object is a member of the Availabilities collection.

Using the Availability Object

Use Availabilities(Index), where Index is the availability index number, to return a single Availability object. The following example returns the availability information from the first line of the Resource Availability grid for the specified resource.

MsgBox ActiveProject.Resources("Tom").Name & " is available from " & _
    ActiveProject.Resources("Tom").Availabilities(1).AvailableFrom & " to " & _
        ActiveProject.Resources("Tom").Availabilities(1).AvailableTo & "."

Using the Availabilities Collection

Use the Availabilities property to return an Availabilities collection. The following example displays the range of dates the specified resource is available for work.

Dim Avail As Availability

For Each Avail In ActiveProject.Resources("Tom").Availabilities
    MsgBox "From " & Avail.AvailableFrom & " to " & Avail.AvailableTo
Next Avail

Use the Add method to add an Availability object to the Availabilities collection. The following example adds a line to the Resource Availability grid showing that the specified resource is only available half-time for the month of April.

ActiveProject.Resources("Tom").Availabilities.Add "4/1/2002", "4/30/2002", 50

Properties | Application Property | AvailableFrom Property | AvailableTo Property | AvailableUnit Property | Count Property | Index Property | Item Property | Parent Property

Methods | Add Method | Delete Method

Parent Objects | Resource Object, Resources Collection Object

See Also | Availabilities Property