Webs Collection

Microsoft FrontPage Visual Basic

Webs Collection

Application Webs
Web
Multiple objects

A collection of WebEx objects. Each WebEx object represents a Web site, which can either be disk-based (on a local hard drive) or server-based (on a Web server). The WebEx object is a member of the Webs collection.

Using the Webs collection

Use the Webs property to return the Webs collection. You can also use the Application property to return the Application object. The following statement uses the Application object to return the first item in the Webs collection or use the second statement to return the entire collection of Web sites.

Set myWebOne = Application.Webs(0)
Set myWebs = Application.Webs
		

Use Webs(index), where index is the index number of an item in the Webs collection, to return a single WebEx object. The following statement returns the third Web site in the collection of open WebEx objects.

Set myGetWebThree = Webs(2)
		

Use the Add method to add an item to the list of available items in the Webs collection. The following statement adds the Coho Winery Web site to the Webs collection. If it doesn't exist, FrontPage will create a new Web site at the specified path and open it.

Webs.Add("C:\My Documents\My Web Sites\Coho Winery")
		

Use the Application property to return information about the application from within the Webs collection. The following statement returns the version number of the Application object.

ActiveWeb.Webs.Application.Version
		

Use the Count property to return the number of open Web sites in the Webs collection. The following statement returns the number of open Web sites.

Webs.Count
		

Use the Delete method to permanently delete a Web site from the Webs collection. The following statement deletes the Coho Winery Web site.

Webs.Delete("C:\My Documents\My Web Sites\Coho Winery")
		

Use the Open method to open a Web site. The following statement opens a Web site and adds it to the collection of items in the Webs collection.

Webs.Open("C:\My Documents\My Web Sites\Coho Winery")
		

Use the Parent method when you want to return the container of the Webs collection, which is the application. The following statement returns the Application object.

Set myParent = Webs.Parent