IHTMLWindow2::document Property

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


HRESULT IHTMLWindow2::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 IHTMLWindow2::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