Share via


DispFPHTMLDocument Object

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.


Aa156203.parchild(en-us,office.10).gifDispFPHTMLDocument
Aa156203.space(en-us,office.10).gifAa156203.parchild(en-us,office.10).gifWebEx

Represents the HTML document in the current window. The DispFPHTMLDocument object contains all property information related to the HTML 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 DispFPHTMLDocument object

To access the DispFPHTMLDocument object, use the ActiveDocument property of either the Application object or the PageWindowEx object. The following example returns the active document in the current application.

  Set objDoc = objApp.ActiveDocument

Use the PagewindowEx object's**Document** property to return the HTML document currently in the page window. The following example returns the current DispFPHTMLDocument, modifies its background color and displays its title.

  Sub Document()
'Returns the active HTML document

    Dim objApp As FrontPage.Application
    Dim objDoc As DispFPHTMLDocument
    Dim objPgeWdw As PageWindowEx
    Set objApp = FrontPage.Application
    'Create reference to active page window
    Set objPgeWdw = objApp.ActivePageWindow
    'Create reference to open document
    Set objDoc = objPgeWdw.Document

    With objDoc
        'Display title and change background color
        MsgBox .Title
        .bgColor = "FFFFFF"
    End With
End Sub