Share via


onerror Property

Returns or sets a Variant that represents the value of the onerror attribute that is the name of the script to run when the onerror event fires.

expression.onerror

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

Example

The following example sets the onerror attribute for the first IMG element in the active document.

Dim objImage As FPHTMLImg

Set objImage = ActiveDocument.images.Item(0)

objImage.OnError = "script()"

Applies to | FPHTMLImg Object | FPHTMLInputImage Object | FPHTMLLinkElement Object | FPHTMLObjectElement Object | FPHTMLScriptElement Object | FPHTMLStyleElement Object | FPHTMLWindow2 Object | FPHTMLWindowProxy Object | IHTMLImgElement Object | IHTMLInputImage Object | IHTMLLinkElement Object | IHTMLObjectElement Object | IHTMLScriptElement Object | IHTMLStyleElement Object | IHTMLWindow2 Object