AlternativeText Property

Microsoft Publisher Visual Basic

expression.AlternativeText

expression    Required. An expression that returns one of the objects in the Applies To list.

Remarks

The maximum length of the AlternativeText property is 254 characters. Microsoft Publisher returns an error if the text length exceeds this number.

Example

This example sets the alternative text for the selected shape in the active document. This example assumes that you have a publication that the selected shape is a picture of a duck.

Public Sub Alternative_Text()

    ' The picture of a duck must be selected.
    Publisher.ActiveDocument.Selection.ShapeRange _
        .AlternativeText = "This is a mallard duck."

End Sub