可用性对象 (Project)
Represents a line from the Resource Availability grid for a resource. The Availability object is a member of the Availabilities collection.
使用 Availability 对象
使用 **Availabilityabilities (**Index) ,其中Index 是可用性索引号,可返回单个 Availability 对象。 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 & "."
使用 Availabilities 属性可以返回一个 Availabilities 集合。 以下示例显示指定资源可以进行工作的日期范围。
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 available only half-time during the month of April.
ActiveProject.Resources("Tom").Availabilities.Add "4/1/2012", "4/30/2012", 50
方法
名称 |
---|
Delete |
属性
名称 |
---|
Application |
AvailableFrom |
AvailableTo |
AvailableUnit |
索引 |
Parent |
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈