Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library

IHTMLElement::document Property

Gets the document object for the document that the browser is displaying.


HRESULT IHTMLElement::get_document(IDispatch **p);


Address of a pointer to a variable of type IDispatch that receives the document object.

Return Value

Returns S_OK if successful, or an error value otherwise.


The IHTMLElement::document property retrieves a pointer for the active document even if the browser has hosted a document object of another type (such as a Microsoft Word document). Query the pointer for an IHTMLDocument2 interface to determine if it is indeed an HTML page. The IHTMLDocument2 interface provides access to the Document Object Model (DOM).

Community Additions

© 2015 Microsoft