title | api_name | ms.date | ms.localizationpriority | |
---|---|---|---|---|
Shape.AlternativeText property (Visio) |
|
05/08/2019 |
medium |
Returns or sets the alternative text description associated with an object. Read/write.
expression.AlternativeText
expression A variable that represents a Shape object.
String
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.
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
[!includeSupport and feedback]