Visio) (Shape.AlternativeText 属性

返回或设置与对象关联的替代文本说明。 读/写。

语法

表达式。AlternativeText

expression 一个代表 Shape 对象的变量。

返回值

String

备注

使用此属性可通过 Visio 创建可访问的图表。

注意

从 Microsoft Visio 2016 C2R 开始,可以在页面、形状和主控对象上使用 AlternativeText。

示例

此Visual Basic for Applications (VBA) 宏演示如何设置和获取形状的 AlternativeText 属性。

 public Sub ShapeAlternativeText_Example()  
 
     Dim vsoRectangle As Visio.Shape  
     
      'Create a rectangle shape and add alternative text to it. 
    Set vsoRectangle = ActivePage.DrawRectangle(2, 3, 5, 4)   
    vsoRectangle.AlternativeText = "Rectangle Shape alternative text"  
   
     'Get a Cell object from the shape. 
    Set vsoCell = vsoRectangle.Cells("Width")  
  
     'Use the Shape property to get the Shape object. 
    Set vsoShapeFromCell = vsoCell.Shape  
 
     'Use shape's alternative text to verify the proper Shape 
    'object was returned.  
    Debug.Print vsoShapeFromCell.AlternativeText 
 
 End Sub

支持和反馈

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