|
In the previous example we created new empty site. Let us add a new list in it. C#using System; using System.Collections.Generic; using System.Diagnostics; using System.Text; using MAPILab.SharePoint.Explorer.CodeForm; using MAPILab.SharePoint.Explorer.Utilities.ScriptRunner; public class Tester { static void Main( Microsoft.SharePoint.SPListCollection lists1 ,Microsoft.SharePoint.SPListTemplate microsoftSharePointS2 ,MAPILab.SharePoint.Explorer.CodeForm.MLCodeForm thisForm ,MAPILab.SharePoint.Explorer.Utilities.ScriptRunner.MLBrowser browser ) { // Output browser configuration //browser.Text = "Browser window"; //browser.DisplayMode = MAPILab.SharePoint.Explorer.Utilities.ScriptRunner.DisplayMode.Expanded; browser.ReturnValue = null; } } Visual BasicImports System Imports System.Collections.Generic Imports System.Diagnostics Imports System.Text Imports MAPILab.SharePoint.Explorer.CodeForm Imports MAPILab.SharePoint.Explorer.Utilities.ScriptRunner Public Class Tester Shared Sub Main(ByVal lists1 As Microsoft.SharePoint.SPListCollection, ByVal microsoftSharePointS2 As Microsoft.SharePoint.SPListTemplate, ByVal thisForm As MAPILab.SharePoint.Explorer.CodeForm.MLCodeForm, ByVal browser As MAPILab.SharePoint.Explorer.Utilities.ScriptRunner.MLBrowser) ' Output browser configuration 'browser.Text = "Browser window" 'browser.DisplayMode = MAPILab.SharePoint.Explorer.Utilities.ScriptRunner.DisplayMode.Expanded browser.ReturnValue = Nothing End Sub End Class Let`s modify this code so that new list is created at execution. Reference to newly created list will be returned by method main for further investigation. C#using System; using System.Collections.Generic; using System.Diagnostics; using System.Text; using MAPILab.SharePoint.Explorer.CodeForm; using MAPILab.SharePoint.Explorer.Utilities.ScriptRunner; public class Tester { static void Main( Microsoft.SharePoint.SPListCollection lists1 ,Microsoft.SharePoint.SPListTemplate microsoftSharePointS2 ,MAPILab.SharePoint.Explorer.CodeForm.MLCodeForm thisForm ,MAPILab.SharePoint.Explorer.Utilities.ScriptRunner.MLBrowser browser ) { System.Guid listId = lists1.Add("SampleList", "Sample description", microsoftSharePointS2); // Output browser configuration //browser.Text = "Browser window"; //browser.DisplayMode = MAPILab.SharePoint.Explorer.Utilities.ScriptRunner.DisplayMode.Expanded; browser.ReturnValue = lists1[listId]; } } Visual BasicImports System Imports System.Collections.Generic Imports System.Diagnostics Imports System.Text Imports MAPILab.SharePoint.Explorer.CodeForm Imports MAPILab.SharePoint.Explorer.Utilities.ScriptRunner Public Class Tester Shared Sub Main(ByVal lists1 As Microsoft.SharePoint.SPListCollection, ByVal microsoftSharePointS2 As Microsoft.SharePoint.SPListTemplate, ByVal thisForm As MAPILab.SharePoint.Explorer.CodeForm.MLCodeForm, ByVal browser As MAPILab.SharePoint.Explorer.Utilities.ScriptRunner.MLBrowser) Dim listId As System.Guid listId = lists1.Add("SampleList", "Sample description", microsoftSharePointS2) 'Output browser configuration 'browser.Text = "Browser window" 'browser.DisplayMode = MAPILab.SharePoint.Explorer.Utilities.ScriptRunner.DisplayMode.Expanded browser.ReturnValue =lists1(listId) End Sub End Class New browser window with information about created list will be opened as a result of executing this script: Additional information
|
HarePoint products are recognized by thousands of companies