Returns an IDispatch interface pointer to the active document, if any.
Syntax
HRESULT get_Document( IDispatch **ppDisp );
Parameters
- ppDisp
- Address of an IDispatch variable that receives the pointer to the object's IDispatch interface.
Return Value
Returns one of the following values:
S_OK The operation was successful. E_FAIL The operation failed. E_INVALIDARG One or more parameters are invalid. E_NOINTERFACE The interface is not supported.
Remarks
When the active document is an HTML page, the IWebBrowser2::get_Document method provides access to the contents of the HTML document object model. Specifically, it returns an IDispatch interface pointer to the HTMLDocument component object class (coclass). The HTMLDocument coclass is functionally equivalent to the DHTML document object used in HTML script. It supports all the properties and methods necessary to access the entire contents of the active HTML document.
C++ programs can retrieve the COM interfaces IHTMLDocument, IHTMLDocument2, and IHTMLDocument3 by calling QueryInterface on the IDispatch received from the IWebBrowser2::get_Document method.
When other document types are active, such as a Microsoft® Word document, the Document property of an IHTMLDocument returns the default IDispatch dispatch interface (dispinterface) pointer for the hosted document object. For Word documents, this would be functionally equivalent to the Document object in the Word object model. For more information on the document object models of Microsoft® Office documents, refer to the Microsoft Office Development Documentation on MSDN .
Windows CE
Windows CE Use version 2.12 and later Minimum availability Internet Explorer 4.0
See Also
IWebBrowser2::get_Application, IWebBrowser2::get_Container, IWebBrowser2::get_Parent