共用方式為


Shape.AlternativeText 屬性 (Visio)

會傳回或設定與 物件相關聯的替代文字描述。 讀取/寫入。

語法

運算式AlternativeText

表達 代表 Shape 物件的變數。

傳回值

字串

註解

使用此屬性可使用 Visio 建立可存取的圖表。

注意事項

從 Microsoft Visio 2016 C2R 開始,您可以在PageShapeMaster物件上使用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 支援與意見反應