IHTMLTitleElement Object

Microsoft FrontPage Visual Basic

IHTMLTitleElement Object

IHTMLTitleElement

Represents a TITLE element in an HTML document. The IHTMLTitleElement object provides access to a limited number of properties and methods related to the TITLE element. For access to all properties and methods, use the FPHTMLTitleElement object.

Using the IHTMLTitleElement object

Use the tags method to return an IHTMLElementCollection collection that represents a collection of all the TITLE elements in a document. Use the Item method to return an IHTMLTitleElement object that accesses a specific TITLE element, referenced by ordinal number or by the value of the id attribute. The following example accesses the first TITLE element in the active document.

    Dim objTitle As FPHTMLTitleElement

Set objTitle = ActiveDocument.all.tags("title").Item(0)
  

Note  While there can only be one TITLE element in an HTML document, the tags method by default returns an IHTMLElementCollection. Therefore, you must use the Item method to return a single IHTMLTitleElement object.

Note  You can set the value of the TITLE element by using the title property.