ShapeRange.AlternativeText Property

Publisher Developer Reference

Returns or sets a String representing the text displayed by a Web browser in place of the Shape object while the Shape object is being downloaded or when graphics are turned off. Read/write.

Syntax

expression.AlternativeText

expression   A variable that represents a ShapeRange object.

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.

Visual Basic for Applications
  Public Sub Alternative_Text()
' The picture of a duck must be selected.
Publisher.ActiveDocument.Selection.ShapeRange _
    .<strong class="bterm">AlternativeText</strong> = "This is a mallard duck."

End Sub

See Also