Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
Sub CreateWeb()
'Set up variables
Dim myWeb As FrontPage.Web
Dim myFPApp As FrontPage.Application
'Create a new FrontPage application object
Set myFPApp = CreateObject("FrontPage.Application")
'*******************************************************************
'* In the following line of code, replace "mySite" with the name
'* of the web server on which you want to create your web and replace
'* "myWeb" with the name for your new web.
'*
'* You can also replace "http://mySite/myWeb" with a local disk
'* path (such as "c:\myWebs\myNewWeb") to create a disk-based web.
'*******************************************************************
'Create the web
Set myWeb = myFPApp.Webs.Add("http://mySite/myWeb")
'Add a home page and home navigation node
myWeb.RootFolder.Files.Add myWeb.Properties("vti_welcomenames")(0)
End Sub
When the
Add method of the Webs collection is used, an empty Web is created. By setting the
vti_welcomenames property of the newly created Web, you can create a home page and a home navigation node for the Web.