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

Properties.Item 属性 (访问)Properties.Item Property (Access)

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

Item属性返回集合中的位置或索引中的特定成员。只读对象The Item property returns a specific member of a collection either by position or by index. Read-only Object.

语法Syntax

表达式项目(* 索引)expression. **Item( ** Index* )

表达式_一个表示属性对象的变量。_expression A variable that represents a Properties object.

参数Parameters

名称Name必需/可选Required/Optional数据类型Data Type说明Description
IndexIndex必需RequiredVariantVariant一个表达式,指定集合的成员的位置引用的_表达式_参数。如果是数值表达式,则_index_参数必须为介于 0 值与该集合的Count属性减 1。如果是字符串表达式,则_index_参数必须为集合成员的名称An expression that specifies the position of a member of the collection referred to by the expression argument. If a numeric expression, the index argument must be a number from 0 to the value of the collection's Count property minus 1. If a string expression, the index argument must be the name of a member of the collection

注解Remarks

如果为_index_参数提供的值与集合的任何现有成员都不匹配,则会导致出错。If the value provided for the index argument doesn't match any existing member of the collection, an error occurs.

Item属性是集合的默认成员,所以不需要显式指定。例如,以下两行代码是等效的:The Item property is the default member of a collection, so you don't have to specify it explicitly. For example, the following two lines of code are equivalent:

Debug.Print Modules(0)
Debug.Print Modules.Item(0)

另请参阅See also

概念Concepts

属性集合Properties Collection

© 2018 Microsoft