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.

Properties | activeElement Property | alinkColor Property | all Property | anchors Property | applets Property | behaviorElement Property | bgColor Property | Body Property | cookie Property | currentStyleState Property | defaultCharset Property | DocumentHTML Property | domain Property | embeds Property | fgColor Property | fileCreatedDate Property | fileModifiedDate Property | fileSize Property | fileUpdatedDate Property | forms Property | frames Property | hasSharedBorders Property | htmlViewText Property | ignoreSharedBorders Property | images Property | isDirty Property | lastModified Property | layoutTablesAndCells Property | linkColor Property | links Property | location Property | mimeType Property | mseMode Property | nameProp Property | onafterupdate Property | onbeforeupdate Property | onclick Property | ondblclick Property | ondragstart Property | onerrorupdate Property | onhelp Property | onkeydown Property | onkeypress Property | onkeyup Property | onmousedown Property | onmousemove Property | onmouseout Property | onmouseover Property | onmouseup Property | onreadystatechange Property | onrowenter Property | onrowexit Property | onselectstart Property | pageContentElement Property | parentWindow Property | plugins Property | protocol Property | ReadyState Property | referrer Property | scripts Property | security Property | selection Property | styleSheets Property | templateRegions Property | title Property | URL Property | ViewMode Property | vlinkColor Property | web Property | webbots Property | webParts Property | webPartZones Property

Methods | addScript Method | applyDynamicTemplate Method | clear Method | close Method | createElement Method | createStyleSheet Method | createStyleState Method | createUndoTransaction Method | dynamicTemplate Property | elementFromPoint Method | execCommand Method | execCommandShowHelp Method | Find Method | getScript Method | InsertInteractiveButton Method | open Method | optimizeHTML Method | parseCodeChanges Method | queryCommandEnabled Method | queryCommandIndeterm Method | queryCommandState Method | queryCommandSupported Method | queryCommandText Method | queryCommandValue Method | reapplyScript Method | removeScript Method | save Method | toString Method | updateDynamicTemplate Method | write Method | writeFile Method | writeln Method

Events | onafterupdate Event | onbeforeupdate Property | onclick Event | ondblclick Event | ondragstart Event | onerrorupdate Event | onhelp Event | onkeydown Property | onkeypress Event | onkeyup Event | onmousedown Event | onmousemove Event | onmouseout Event | onmouseover Event | onmouseup Event | onreadystatechange Property | onrowenter Event | onrowexit Event | onselectstart Event

Parent Objects

Child Objects | IFPStyleState Object | IHTMLElement Object | IHTMLElementCollection Object | IHTMLFramesCollection2 Object | IHTMLLocation Object | IHTMLSelectionObject Object | IHTMLStyleSheetsCollection Object | IHTMLWindow2 Object