FPHTMLDocument Object

Microsoft FrontPage Visual Basic

FPHTMLDocument Object

FPHTMLDocument Multiple objects

Represents the active HTML document. The FPHTMLDocument object contains all property information related to the HTML in a Web page such as background color, link color, and style sheet as well as methods that act on the data such as the CreateElement and ExecCommand methods.

Using the FPHTMLDocument object

Use the ActiveDocument property of the Application object or the Document property of the PageWindowEx object to return an FPHTMLDocument object. The following example modifies the background color of the current document.

Sub Document()
    Dim objDoc As FPHTMLDocument
    Dim objWindow As PageWindowEx
    
    'Create a reference to the active page window.
    Set objWindow = ActivePageWindow
    
    'Create a reference to the currently open document.
    Set objDoc = objWindow.Document

    objDoc.bgColor = "yellow"
End Sub
		

Note    There is no way to access the contents of a Web page using Microsoft Visual Basic for Applications in Microsoft FrontPage without first opening the document and setting it as the active document using either the ActivePageWindow property, as shown in the preceding example, or the ActiveDocument property.

Remarks

The PageWindowEx object, in the FrontPage Web Object Model, contains both an ActiveDocument property and a Document property. Both properties return an FPHTMLDocument object. However, when a FRAMESET element is contained within a page, the Document property returns the page containing the FRAMESET element, and the ActiveDocument property returns the page referenced in the SRC attribute of the FRAME element where the insertion point currently resides.