This the vb code for creating a workspace
'==================================================================
' CreateWorkspace
'
' Description: creates a workspace
'
' Arguments: sName - name of the new workspace
'==================================================================
Function CreateWorkspace(sName As String) As String
Dim sNewWorkspaceURL As String
Dim sComputerName As String
Dim sServerUrl As String
Dim sProgramFiles As String
Dim sInstallPath As String
Dim sContentPath As String
Dim sSchemaPath As String
sComputerName =
GetEnvironmentVariable("COMPUTERNAME")
Dim objServer As PKMCDO.KnowledgeServer
Set objServer = New PKMCDO.KnowledgeServer
sServerUrl = "http://" + sComputerName +
"/SharePoint Portal Server/workspaces/"
objServer.DataSource.Open sServerUrl, ,
adModeReadWrite
sNewWorkspaceURL = "http://" + sComputerName + "/"
+ sName
sProgramFiles =
GetEnvironmentVariable("PROGRAMFILES")
sInstallPath = sProgramFiles + "\SharePoint Portal
Server\bin\"
sContentPath = sInstallPath +
"defaultworkspace.cab"
sSchemaPath = sInstallPath + "localschema.xml"
' This call may take a while
objServer.CreateWorkspace sNewWorkspaceURL,
sSchemaPath, sContentPath
CreateWorkspace = sNewWorkspaceURL
End Function