Table of contents

Styles.Item 属性 (Visio)Styles.Item Property (Visio)

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

从集合中返回一个项。Item属性是所有集合的默认属性。只读的。Returns an item from a collection. The Item property is the default property for all collections. Read-only.


表达式项目( NameOrIndex )expression . Item( NameOrIndex )

表达式_一个表示样式集合的变量。_expression A variable that represents a Styles collection.


名称Name必需/可选Required/Optional数据类型Data Type说明Description
NameOrIndexNameOrIndex必需RequiredVariantVariant包含要检索的对象的名称、唯一 ID 或索引。Contains the name, unique ID, or index of the object to retrieve.

返回值Return Value



当从集合中检索对象,您可以省略表达式中的Item ,因为它是所有集合的默认属性。以下语句是等效于上面给出的语法示例:When retrieving objects from a collection, you can omit Item from the expression because it is the default property for all collections. The following statements are equivalent to the syntax example given above:

objRet = object(index) 
objRet = object(stringExpression) 

您可以加载项文档字体超链接图层母版MasterShortcutsOLEObjects形状样式中的对象通过传递对象的名称作为字符串表达式中一个variant 类型的值的集合。You can retrieve an object in an Addons , Documents , Fonts , Hyperlinks , Layers , Masters , MasterShortcuts , OLEObjects , Pages , Shapes , or Styles collection by passing the object's name as a string expression in a Variant .

将 ID 字符串传递给Item属性的详细信息,请参阅此参考中的UniqueID属性的主题。For more information about passing ID strings to the Item property, see the topic for the UniqueID property in this Automation Reference.


从 Microsoft Visio 2000 开始,您可以使用本地名称和通用名称来引用 Visio 形状、主控形状、文档、页面、行、加载项、单元格、超链接、样式、字体、主控形状快捷方式、UI 对象和图层。例如,当用户命名形状时,用户将指定一个本地名称。从 Microsoft Office Visio 2003 开始,ShapeSheet 电子表格在单元格公式和值中只显示通用名称。(在以前的版本中,通用名称在用户界面中不可见。)Beginning with Microsoft Visio 2000, you can use both local and universal names to refer to Visio shapes, masters, documents, pages, rows, add-ons, cells, hyperlinks, styles, fonts, master shortcuts, UI objects, and layers. When a user names a shape, for example, the user is specifying a local name. Beginning with Microsoft Office Visio 2003, the ShapeSheet spreadsheet displays only universal names in cell formulas and values. (In prior versions, universal names were not visible in the user interface.)

作为开发人员,您可以在程序中使用通用名称时,您不希望每次本地化解决方案时都更改名称。使用Item属性来使用其本地名称来访问主控形状页面形状样式图层MasterShortcuts集合中的对象。使用ItemU属性通过使用对象的通用名称从上述任一集合访问的对象。As a developer, you can use universal names in a program when you don't want to change a name each time a solution is localized. Use the Item property to access an object in the Masters , Pages , Shapes , Styles , Layers , or MasterShortcuts collection by using its local name. Use the ItemU property to access an object from one of these collections by using the object's universal name.

© 2018 Microsoft