This interface retrieves information about the document, and examines and modifies the HTML elements and text within the document.
IHTMLDocument2 Methods
clear Not supported. close Closes an output stream and forces data sent to layout to display. createElement Creates an instance of the element object for the specified tag. createStyleSheet Not supported. elementFromPoint Retrieves the element at the specified x and y coordinates. execCommand Executes the given command over the current selection or text range. execCommandShowHelp Displays help information for the given command identifier. get_activeElement Retrieves a pointer to the interface of the element that has the focus, which is determined by the activeElement property. get_alinkColor Retrieves the color that the browser uses to indicate the active link. get_all Retrieves an interface pointer to a zero-based collection of all the elements in an HTML document. get_anchors Retrieves an interface pointer to a zero-based collection of all the A objects in an HTML document. The elements are in the same order as they appear in the document. get_applets Retrieves an interface pointer to a zero-based collection of all the APPLET objects in an HTML document. The objects are in the same order as they appear in the document. get_bgColor Retrieves the background color of the page. get_body Retrieves an interface pointer to the document's BODY object. get_charset Retrieves the character set used to encode the document. get_cookie Retrieves the string value of a cookie, which is a small piece of information stored by the browser. get_defaultCharset Retrieves the default character set of the document. get_designMode Not supported. get_domain Retrieves the security domain of the document. get_embeds Retrieves an interface pointer to a zero-based collection of all the EMBED objects in an HTML document. The objects are in the same order as they appear in the document. get_expando Retrieves the value that indicates whether the document supports the use of expando properties. get_fgColor Retrieves the color of the document foreground text. get_fileCreatedDate Retrieves the date when the document file was created. get_fileModifiedDate Retrieves the date the document was last modified. get_fileSize Retrieves the size, in bytes, of the document file. get_fileUpdatedDate Not supported. get_forms Retrieves an interface pointer to a zero-based collection of all the FORM objects in an HTML document. The objects are in the same order as they appear in the document. get_frames Retrieves an interface pointer to a zero-based collection of all the FRAME objects in an HTML document, if the document contains the FRAMESET object. If the document contains the BODY object, this is a collection of all IFRAME objects in the document. In either case, the objects are in the same order as they appear in the document. get_images Retrieves a pointer to the IHTMLElementCollection interface of the zero-based collection of all the images in an HTML document. The images are in the same order as they appear in the document. get_lastModified Retrieves a string that contains the last-modified date of the page (if the page provides one). get_linkColor Retrieves the color of the document links. get_links Retrieves an interface pointer to a zero-based collection of all the LINK and AREA objects in an HTML document. The objects are in the same order as they appear in the document. get_location Retrieves an interface pointer to a location object. The object contains information about the current location (full URL) of the document. get_mimeType Retrieves the type for the document file. get_nameProp Retrieves the title of the document file. get_onafterupdate Retrieves a pointer to the event handler function associated with the onafterupdate event on the object. get_onbeforeupdate Retrieves a pointer to the event handler function associated with the onbeforeupdate event on the object. get_onclick Retrieves a pointer to the event handler function associated with the onclick event on the object. get_ondblclick Retrieves a pointer to the event handler function associated with the ondblclick event on the object. get_ondragstart Retrieves a pointer to the event handler function associated with the ondragstart event on the object. get_onerrorupdate Retrieves a pointer to the event handler function associated with the onerrorupdate event on the object. get_onhelp Retrieves a pointer to the event handler function associated with the onhelp event on the object. get_onkeydown Retrieves a pointer to the event handler function associated with the onkeydown event on the object. get_onkeypress Retrieves a pointer to the event handler function associated with the onkeypress event on the object. get_onkeyup Retrieves a pointer to the event handler function associated with the onkeyup event on the object. get_onmousedown Retrieves a pointer to the event handler function associated with the onmousedown event on the object. get_onmousemove Retrieves a pointer to the event handler function associated with the onmousemove event on the object. get_onmouseout Retrieves a pointer to the event handler function associated with the onmouseout event on the object. get_onmouseover Retrieves a pointer to the event handler function associated with the onmouseover event on the object. get_onmouseup Retrieves a pointer to the event handler function associated with the onmouseup event on the object. get_onreadystatechange Retrieves a pointer to the event handler function associated with the onreadystatechange event on the object. get_onrowenter Retrieves a pointer to the event handler function associated with the onrowenter event on the object. get_onrowexit Retrieves a pointer to the event handler function associated with the onrowexit event on the object. get_onselectstart Retrieves a pointer to the event handler function associated with the onselectstart event on the object. get_parentWindow Retrieves an interface pointer to the window object for the document. get_plugins Retrieves an interface pointer to a zero-based collection of all the EMBED objects in an HTML document. The objects are in the same order as they appear in the document. get_protocol Retrieves the protocol portion of the URL that the browser uses to locate the document file. The protocol portion, which indicates the access method, includes the initial substring of the URL up to and including the first colon. get_readyState Retrieves the current status of an object being downloaded. get_referrer Retrieves the URL of the previous location. get_scripts Retrieves an interface pointer to a zero-based collection of all the SCRIPT objects in an HTML document. The objects are in the same order as they appear in the document. get_security Retrieves security information for the document. get_selection Retrieves an interface pointer to an object representing the active selection. The active selection can be an insertion point, or a highlighted block of text or other elements in the document upon which the user or a script can carry out an action. get_styleSheets Retrieves an interface pointer to a zero-based collection of the style sheet objects exposed from the document object. Each style sheet object represents an individual style sheet that is defined for the document. get_title Retrieves the title of the document. The title identifies the contents of the document and is displayed in the header bar of the document window. get_URL Retrieves the URL for the current document. get_vlinkColor Retrieves the color of links that have already been visited. open Opens a stream to collect the output of the write or writeln method. put_alinkColor Sets the color that the browser uses to indicate the active link. put_bgColor Sets the background color of the page. put_charset Specifies the character set used to encode the document. put_cookie Sets the string value of a cookie, which is a small piece of information stored by the browser. put_defaultCharset Specifies the default character set of the document. put_designMode Not supported. put_domain Sets the security domain of the document. put_expando Sets the value that indicates whether the document supports the use of expando properties. put_fgColor Sets the color of the document foreground text. put_linkColor Sets the color of the document links. put_onafterupdate Sets a pointer to the event handler function associated with the onafterupdate event on the object. put_onbeforeupdate Sets a pointer to the event handler function associated with the onbeforeupdate event on the object. put_onclick Sets a pointer to the event handler function associated with the onclick event on the object. put_ondblclick Sets a pointer to the event handler function associated with the ondblclick event on the object. put_ondragstart Sets a pointer to the event handler function associated with the ondragstart event on the object. put_onerrorupdate Sets a pointer to the event handler function associated with the onerrorupdate event on the object. put_onhelp Sets a pointer to the event handler function associated with the onhelp event on the object. put_onkeydown Sets a pointer to the event handler function associated with the onkeydown event on the object. put_onkeypress Sets a pointer to the event handler function associated with the onkeypress event on the object. put_onkeyup Sets a pointer to the event handler function associated with the onkeyup event on the object. put_onmousedown Sets a pointer to the event handler function associated with the onmousedown event on the object. put_onmousemove Sets a pointer to the event handler function associated with the onmousemove event on the object. put_onmouseout Sets a pointer to the event handler function associated with the onmouseout event on the object. put_onmouseover Sets a pointer to the event handler function associated with the onmouseover event on the object. put_onmouseup Sets a pointer to the event handler function associated with the onmouseup event on the object. put_onreadystatechange Sets a pointer to the event handler function associated with the onreadystatechange event on the object. put_onrowenter Sets a pointer to the event handler function associated with the onrowenter event on the object. put_onrowexit Sets a pointer to the event handler function associated with the onrowexit event on the object. put_onselectstart Sets a pointer to the event handler function associated with the onselectstart event on the object. put_title Sets the title of the document. The title identifies the contents of the document and is displayed in the header bar of the document window. put_URL Sets the URL for the current document. This function causes the browser to browse to the location specified by the URL. put_vlinkColor Sets the color of links that have already been visited. queryCommandEnabled Determines whether the given command is currently available. queryCommandIndeterm Determines whether the given command is in the indeterminate state. queryCommandState Retrieves the current status of the given command. The status indicates whether the command has been carried out on the object. queryCommandSupported Determines whether the given command is supported. queryCommandText Retrieves the string associated with a command. queryCommandValue Retrieves the current value of the given command. toString Retrieves a string representation of the document object. write Writes one or more HTML expressions to a document in the specified window. writeln Writes one or more HTML expressions to a document in the specified window, followed by a carriage return.
Interface Information
Implementation System (Mshtml.dll) Inherits from IDispatch Header and IDL files Mshtml.h, Mshtml.idl Minimum availability Internet Explorer 4.0 Minimum operating systems Windows 95, Windows NT 4.0
Windows CE
For Microsoft® Windows® CE only, programmatic access to documents in windows created with the open method is not supported.
Windows CE Use version 2.12 and later Minimum availability Internet Explorer 4.0
Remarks
Typically, every window object has a corresponding document object that you can retrieve by calling the IUnknown::QueryInterface method with the IID_IHTMLDocument or IID_IHTMLDocument2 interface identifiers. Windows that contain HTML documents always have valid document objects, but windows that contain documents in other formats might not.
In general, before attempting to retrieve the document object for a window that is not the current window, make sure that the source file associated with that window is an HTML document file or a file that can be represented as an HTML document (for example, a text file).
See Also
IHTMLDocument::events