Document Property (Web Object Model)

Microsoft FrontPage Visual Basic

Returns an FPHTMLDocument object, providing access to the Page object model in Microsoft FrontPage that is compatible with Microsoft Internet Explorer 4.0 and later. For more information on the Page object model, see Exploring the Object Model in FrontPage.

expression.Document

expression    Required. An expression that returns a PageWindowEx object.

Example

The following example opens a page and uses the insertAdjacentText method to add text to the document.

Note  To run this example, you must have a Web site called "C:\My Documents\My Web Sites\Rogue Cellars" that contains a file named Sales.htm. You may substitute an alternative Web site URL or file name.

Private Sub AddTextToDoc()
    Dim myWeb As WebEx
    Dim myPageWindow As PageWindowEx
    Dim myText As String

    Set myWeb = _
        Webs.Open("C:\My Documents\My Web Sites\Rogue Cellars")
    myWeb.Activate
    myText = "Winter Sale Begins November 1st!"
    Set myPageWindow = _
        ActiveWeb.RootFolder.Files("Sales.htm").Edit

    myPageWindow.Document.body.insertAdjacentText _
        "BeforeEnd", myText

    ActivePageWindow.Save
    ActiveWeb.Close
End Sub