This documentation is archived and is not being maintained.

altHTML Property

Office 2003

Sets or returns a String that represents the optional alternative HTML to display if the specified object fails to load when the page is displayed in a browser.


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


The following example inserts an object into the active document, and then specifies the alternative HTML to display if the object fails to load. The value of the classid attribute used in this example is intentionally incorrect to demonstrate how the alternative HTML is displayed when the document is displayed in a browser. To insert a calendar control into a Web page, replace the value of the classid attribute below with clsid:8E27C92B-1264-101C-8A2F-040224009C02.

Sub InsertCalendar()
    Dim objObject As FPHTMLObjectElement

    With ActiveDocument
        .body.innerHTML = "<object classid=" & _
            """clsid:8E27C92B-1262-101C-8A2F-040224009C02"" " _
            & "id=""Calendar1"">" & vbCrLf & "</object>"
    End With
    Set objObject = ActiveDocument.body.all.tags("object") _
    objObject.altHtml = "<p><i>There is a problem displaying the calendar.</i><p>"
End Sub

Note  In addition to inserting the OBJECT element into the document, when a valid object is inserted into a document, Microsoft FrontPage inserts the necessary <param> tags into the OBJECT element.