Document Property

       

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

Example

This 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 called "C:\My Documents\My Webs\Rogue Cellars" (for a server running on Microsoft Windows) or "C:\WINNT\Profiles\logon alias\Personal\My Webs\Rogue Cellars" (for a server running on Windows NT). In either case, you may substitute an alternative web URL or file. You must also have a file named Sales.htm or substitute an alternative file.

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

    Set myWeb = _
        Webs.Open("C:\My Documents\My Webs\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