Share via

IHTMLDocument2::title Property

Sets or gets the title of the document.


HRESULT IHTMLDocument2::get_title(BSTR *p);
HRESULT IHTMLDocument2::put_title(BSTR v);


  • p
    Pointer to a variable of type BSTR that receives the title.
  • v
    BSTR that specifies the title.

Return Value

Returns S_OK if successful, or an error value otherwise.


The title identifies the contents of the document and is displayed in the header bar of the document window. This function sets or gets the TITLE object in the document header (defined by the HEAD object).