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

ID: Q240671


The information in this article applies to:
  • Microsoft FrontPage 2000


SUMMARY

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


MORE INFORMATION

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.



    
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.


REFERENCES

For more information about using the sample code in this article, click the article number below to view the article in the Microsoft Knowledge Base:

Q212536 OFF2000: How to Run Sample Code from Knowledge Base Articles

Additional query words: fp2k vba FP2000 vb vbe

Keywords : kbdtacode
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: September 8, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.