Back to Devexpress

DrawingObject.AltText Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-drawingobject-9e6c135f.md

latest3.4 KB
Original Source

DrawingObject.AltText Property

Gets or sets the alternative text for a shape.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
string AltText { get; set; }
vb
Property AltText As String

Property Value

TypeDescription
String

The descriptive text associated with a shape.

|

Remarks

The AltText property contains all alternative text for a shape (a combination of Title and Description property values).

If you assign text to the AltText property, it is copied to the Description property and the Title property is set to null.

The following code snippet adds Alt Text to a shape:

csharp
Document document = wordProcessor.Document;
// Create a callout and specify its alternative text.
Shape shape = document.Shapes.InsertShape(document.Range.Start, ShapeGeometryPreset.AccentLineCallout1);
shape.AltText = "A callout with an accent bar and a straight callout line.";
vb
Dim document As Document = wordProcessor.Document
' Create a callout and specify its alternative text.
Dim shape As Shape = document.Shapes.InsertShape(document.Range.Start, ShapeGeometryPreset.AccentLineCallout1)
shape.AltText = "A callout with an accent bar and a straight callout line."

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AltText property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

office-file-api-ai-implementation/CS/Controllers/AccessibilityController.cs#L39

csharp
{
    if (shape.Type == DevExpress.XtraRichEdit.API.Native.ShapeType.Picture && string.IsNullOrEmpty(shape.AltText))
    {

See Also

Title

Description

DrawingObject Interface

DrawingObject Members

DevExpress.XtraRichEdit.API.Native Namespace