Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FP2000: How to Create a One-Page Web Using Visual Basic for Applications


View products that this article applies to.

This article was previously published under Q240671

↑ Back to the top


Summary

This article describes how to create a one-page Web using Visual Basic for Applications in FrontPage 2000.

↑ Back to the top


More information

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.

↑ Back to the top


References

For more information about how to use the sample code in this article, click the article number below to view the article in the Microsoft Knowledge Base:
212536 OFF2000: How to Run Sample Code from Knowledge Base Articles

↑ Back to the top


Keywords: KB240671, kbprogramming, kbhowto, kbdtacode

↑ Back to the top

Article Info
Article ID : 240671
Revision : 4
Created on : 10/11/2006
Published on : 10/11/2006
Exists online : False
Views : 263