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

项目对象 (项目)Projects Object (Project)

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

包含的项目对象的集合。Contains a collection of Project objects.

示例Example

使用项目对象Using the Project Object

使用项目(索引) 的索引所在的项目索引编号或项目名称,返回一个项目对象。下面的示例在所有打开的项目之间切换,全名的每一个,然后显示结果。Use Projects (Index), where Index is the project index number or project name, to return a single Project object. The following example switches among all the open projects, memorizes the full name of each, and then displays the results.

Dim Temp As Long, Names As String 



For Temp = 1 To Projects.Count 

 Projects(Temp).Activate 

 Names = Names & Projects(Temp).FullName & vbCrLf 

Next Temp 



MsgBox Names

使用项目集合Using the Projects Collection

使用项目属性可返回的项目集合。下面的示例对打开的项目数进行计数。Use the Projects property to return a Projects collection. The following example counts the number of open projects.

Application.Projects.Count

因为Projects集合是顶级对象,下面的示例在功能上等同于上面的代码。Because the Projects collection is a top-level object, the following example is functionally identical to the preceding one.

Projects.Count

使用Add方法可向项目集合中添加一个项目对象。下面的示例创建一个新的项目而无需提示项目信息。Use the Add method to add a Project object to the Projects collection. The following example creates a new project without prompting for project information.

Projects.Add False

方法Methods

名称Name
AddAdd
CanCheckOutCanCheckOut
签出CheckOut

属性Properties

名称Name
ApplicationApplication
CountCount
ItemItem
ParentParent

另请参阅See also

其他资源Other resources

项目对象模型Project Object Model

© 2018 Microsoft