Project.AutoAddResources 属性 (Project)

如此 如果新资源时自动创建分配。 如果项目之前创建新的资源会提示。 读/写 Boolean

语法

expressionAutoAddResources

表达 一个代表 Project 对象的变量。

示例

下面的示例将提示用户设置 AutoAddResources自动计算AutoLinkTasksAutoSplitTasksAutoTrack 属性。

Sub PromptForAutoPropertySettings() 
    Dim I As Integer ' Used in For...Next loop 
    Dim Prompts(5) As String ' Prompts to display on the screen 
    Dim Response As Long ' User response to prompt 
    Dim Responses(5) As Long ' Used to store user responses 
 
    ' Set each prompt. 
    Prompts(1) = "Automatically create new resources as they are assigned?" 
    Prompts(2) = "Automatically recalculate a project when a value, such as a date or cost, changes?" 
    Prompts(3) = "Automatically link sequential tasks when you cut, move, or insert tasks?" 
    Prompts(4) = "Automatically split tasks into parts for work complete and work remaining?" 
    Prompts(5) = "Automatically update the remaining work and cost for a resource when the completion percentage of one of the resource's tasks changes?" 
 
    ' Display each prompt, and store the user's responses. 
    For I = 1 To 5 
        Response = MsgBox(Prompts(I), vbYesNo) 
        Responses(I) = (Response = vbYes) 
    Next I 
 
    ' Set the automatic properties according to the user's responses. 
    ActiveProject.AutoAddResources = Responses(1) 
    Calculation = Responses(2) 
    ActiveProject.AutoLinkTasks = Responses(3) 
    ActiveProject.AutoSplitTasks = Responses(4) 
    ActiveProject.AutoTrack = Responses(5) 
End Sub

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。