Редагувати

Поділитися через


Shape.AlternativeText property (Visio)

Returns or sets the alternative text description associated with an object. Read/write.

Syntax

expression.AlternativeText

expression A variable that represents a Shape object.

Return value

String

Remarks

Use this property to create accessible diagrams by using Visio.

Note

Beginning with Microsoft Visio 2016 C2R, you can use AlternativeText on Page, Shape, and Master objects.

Example

This Visual Basic for Applications (VBA) macro shows how to set and get the AlternativeText property of a shape.

 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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.