ActiveWeb Property

Microsoft FrontPage Visual Basic

Returns a WebEx object that represents the Web site currently open in Microsoft FrontPage.

expression.ActiveWeb

expression    Required. An expression that returns an Application object.

Remarks

The Microsoft FrontPage Visual Basic for Applications object model provides access to the Web object model through the ActiveWeb property. For more information about the FrontPage object models, see Exploring the Object Model in FrontPage.

Example

This example uses the ActiveWeb property to locate the Web page index.htm and changes the background color of the page.

Note  To run this example, create a form with one command button called cmdActiveWebColorChange and paste the following code in the code window. You must have a Web page called index.htm for this procedure to change the background color.

Private Sub cmdActiveWebBKGRDColorChange_Click()
    Dim myPageWin As PageWindowEx

    Set myPageWin = Application.ActiveWeb.LocatePage("index.htm")

    myPageWin.Document.bgColor = "PapayaWhip"

End Sub

Note  Microsoft Visual Basic provides color constants with a "vb" prefix, such as vbCyan. FrontPage builds Web pages in HTML, which uses different color constants than Visual Basic. If you use the color constants provided with Visual Basic in your existing programs, you may need to change these to the equivalent hexadecimal color values when you port your programs to a FrontPage-based Web site, or when you use colors across Microsoft Office applications that include a FrontPage-based Web site.