WebWindowEx Object

Microsoft FrontPage Visual Basic

WebWindowEx Object

WebWindowEx Multiple objects

Represents a Microsoft FrontPage application window in which a Web site is opened. The WebWindowEx object is a member of the WebWindows collection. The WebWindows collection represents all of the open application windows in a specified Web site or within FrontPage. Within the WebWindows collection, individual WebWindowEx objects are indexed beginning with zero. Each Web site that is opened in FrontPage is contained in a new WebWindowEx object, unless it is opened in a windowless environment by setting the Visible property of the WebWindowEx object to False. For more information on windowless environments, see Coding in a Windowless Environment.

Using the WebWindow object

Use the WebWindow property to return information about an open WebWindowEx object. You can also use the PageWindows property to return information about the collection of open pages in a WebWindowEx object. Use WebWindows(index), where index is the index number of an application window item, to return a single WebWindow object. The following statement returns the ViewMode property of the first Web site in the WebWindows collection.

myViewMode = WebWindows(0).ViewMode
		

You can also use the ViewMode property to switch between view modes by setting the view mode as shown in the following statement, which switches the current view mode to Navigation view.

ActiveWebWindow.ViewMode = fpWebViewStructure
		

The Activate method puts the focus on the specified WebWindowEx object. The following statements activates the first Web sites in the collection of open windows.

myWebWindow = WebWindows(0)
myWebWindow.Activate
		

The ActivePageWindow property returns the active PageWindowEx object. The following statements return the URL and the caption of the active PageWindowEx object. The value returned for the caption in this case is a file name, such as "Index.htm".

urlThisDoc = WebWindow.ActivePageWindow.Document.Url
fileName = WebWindow.ActivePageWindow.Caption
		

You can also return the Caption property from the WebWindowEx object. In this case, the text that is returned reflects the text in the title bar of the FrontPage application window, which consists of the application name and the URL of the specified WebWindowEx object, such as "Microsoft FrontPage – C:\My Documents\My Web Sites\Adventure Works". The following statement returns the value of the Caption property of the WebWindowEx object.

thisCaption = WebWindow.Caption
		

Use the Close method to close a WebWindowEx object. The following statement closes the specified WebWindow.

Set myWebWindowOne = WebWindows(0)
myWebWindowOne.Close
		

Use the ViewMode property to return or set one of the values shown in the following table. You can also use these enumerated values to switch views in FrontPage.

Enumermated Constant Value Corresponding View in FrontPage
FpWebViewLinks 0 Hyperlinks view
FpWebViewFolders 1 Folders view
FpWebViewStructure 2 Navigation view
FpWebViewPage 3 Page view
fpWebViewAllFiles 4 View a list of every file in Reports view
FpWebViewTodo 5 View a To Do list in Tasks view
FpWebViewBrokenLinks 6 View a list of broken hyperlinks in Reports view
FpWebFiewSiteSummary 7 Site Summary view in Reports view

The following statement sets the ViewMode property to fpWebViewPage.

WebWindows(0).ViewMode = fpWebViewPage
		

Use the Visible property to return or set a Boolean value for the state of a WebWindowEx object. The Visible property returns True if a WebWindowEx object is visible. The following statement sets a WebWindowEx object to an invisible state.

WebWindow.Visible = False
		

Use the Web property to return information about the WebEx object. The following statement returns the number of properties for the specified Web sites.

myProperties = ActiveWeb.WebWindows(0).Web.Properties.Count