Table of contents
TOC
折叠目录
展开目录

Application.ResourceSharing 方法 (项目)Application.ResourceSharing Method (Project)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

控制本地资源和项目的资源共享。Controls resource sharing, for local resources and projects.

语法Syntax

表达式ResourceSharing(* 共享名称)expression. **ResourceSharing( ** Share, ** Name, ** Pool* )

表达式_一个表示应用程序对象的变量。_expression A variable that represents an Application object.

参数Parameters

名称Name必需/可选Required/Optional数据类型Data Type说明Description
共享Share可选OptionalBooleanBoolean如此如果共享本地资源。如果未指定名称,则忽略共享True if local resources are shared. If Name is specified, Share is ignored.
名称Name可选OptionalStringString包含本地资源库的项目文件的名称。The file name of the project that contains the local resource pool.
Pool可选OptionalBooleanBoolean如此如果本地库中的资源优先项目中的资源。True if resources in the local pool take precedence over resources in the project .

返回值Return Value

BooleanBoolean

注解Remarks

使用ResourceSharing方法,而不指定任何参数将显示ShareResources对话框。Using the ResourceSharing method without specifying any arguments displays the ShareResources dialog box.

请注意 项目专业人员可以共享本地资源仅在不登录项目服务器时。如果项目专业人员使用 Project Server 配置文件,本地资源共享将不可用。Note Project Professional can share local resources only when not logged on Project Server. If Project Professional is using a Project Server profile, local resource sharing is unavailable.

示例Example

在以下示例中,包含要共享的资源的项目名为 SharedResourcePool.mpp。如果活动项目名为 Sharer.mpp,则代码将允许 Sharer.mpp 访问 SharedResourcePool.mpp 中的资源,其中资源库中的资源优先。两个项目都必须处于打开状态。In the following example, the project that contains the resources to share is named SharedResourcePool.mpp. If the active project is named Sharer.mpp, the code enables Sharer.mpp to access resources from SharedResourcePool.mpp, where resources in the pool take precedence. Both projects must be open.

Application.ResourceSharing Share:=False, Name:="SharedResourcePool.mpp", Pool:=True
© 2018 Microsoft