共用方式為


Lists.CreateContentType method

在清單上建立清單內容類型。

Namespace:  WebSvcLists
Assembly:  STSSOAP (in STSSOAP.dll)

Syntax

'宣告
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/CreateContentType", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/",  _
    ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function CreateContentType ( _
    listName As String, _
    displayName As String, _
    parentType As String, _
    fields As XmlNode, _
    contentTypeProperties As XmlNode, _
    addToView As String _
) As String
'用途
Dim instance As Lists
Dim listName As String
Dim displayName As String
Dim parentType As String
Dim fields As XmlNode
Dim contentTypeProperties As XmlNode
Dim addToView As String
Dim returnValue As String

returnValue = instance.CreateContentType(listName, _
    displayName, parentType, fields, _
    contentTypeProperties, addToView)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/CreateContentType", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/", 
    ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public string CreateContentType(
    string listName,
    string displayName,
    string parentType,
    XmlNode fields,
    XmlNode contentTypeProperties,
    string addToView
)

參數

  • listName
    Type: System.String

    包含要建立的內容類型清單的名稱的字串。

  • displayName
    Type: System.String

    String,代表清單內容類型的顯示名稱。

  • parentType
    Type: System.String

    包含所要依據此清單內容類型的網站內容類型的內容類型識別碼的字串。

  • fields
    Type: System.Xml.XmlNode

    字串,代表要包含在新的網站內容類型的欄的集合。

  • contentTypeProperties
    Type: System.Xml.XmlNode

    字串,代表指定之內容類型的屬性。

  • addToView
    Type: System.String

    字串,其中包含"true"或者"false",會指定是否要將內容類型新增至清單檢視中。

傳回值

Type: System.String

請參閱

參照

Lists class

Lists members

WebSvcLists namespace

其他資源

Content Types

Content Type IDs