Document Property
Gets the automation object of the active document, if any.
Syntax
[ oAutomation = ] object.Document
Possible Values
oAutomation Object that receives the automation object. The property is read-only. The property has no default value.
Remarks
When the active document is an HTML page, this property provides access to the contents of the HTML Document Object Model (DOM). Specifically, it returns an HTMLDocument object reference. The HTMLDocument object is functionally equivalent to the HTML document object used in HTML page script. It supports all the properties and methods necessary to access the entire contents of the active HTML document.
Microsoft Visual Basic programs that early bind to the HTMLDocument object can reference it through the IHTMLDocument interface, the IHTMLDocument2 interface, and the IHTMLDocument3 interface.
When other document types are active, such as a Microsoft Word document, this property returns the document automation object of that document. For Word documents, this is the Document object. For more information on the Microsoft Office DOM, refer to the Microsoft Office Developer Center.
Warning If the document object type is not marked safe for scripting, this property returns Nothing. For more information, see Safe Initialization and Scripting for ActiveX Controls.
Applies To
InternetExplorer, WebBrowser
See Also