Share via


Code to Create a Site

In this example, an instance of the GlobalConfig object is instantiated, then initialized. An application named "NewSite" is created and saved.

Create this example using the following Visual Basic code.

  1. Create the GlobalConfig and initialize it.

    Dim oGlobConfig
    Set oGlobConfig = CreateObject("Commerce.GlobalConfig")
    oGlobConfig.Initialize
    
  2. Create a new application. The CreateSiteConfig method creates a site named "NewSite" and returns a SiteConfig object that contains the site configuration settings. After the site is created, save the configuration settings.

    Dim oSiteConfig
    Set oSiteConfig = oGlobConfig.CreateSiteConfig("NewSite")
    oGlobConfig.SaveConfig
    


All rights reserved.