Share via


PublishingWebCollection.Add Method (String, UInt32, String)

Creates a child PublishingWeb object based on the specified Web template.

Namespace:  Microsoft.SharePoint.Publishing
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

Syntax

'Declaration
Public Function Add ( _
    newPublishingWebUrl As String, _
    languageId As UInteger, _
    webTemplateName As String _
) As PublishingWeb
'Usage
Dim instance As PublishingWebCollection
Dim newPublishingWebUrl As String
Dim languageId As UInteger
Dim webTemplateName As String
Dim returnValue As PublishingWeb

returnValue = instance.Add(newPublishingWebUrl, _
    languageId, webTemplateName)
public PublishingWeb Add(
    string newPublishingWebUrl,
    uint languageId,
    string webTemplateName
)

Parameters

  • newPublishingWebUrl
    Type: System.String
    The Name property for the new PublishingWeb object that is to be created. The property maps directly to the syntax for the Add() method. The URL should not have a leading slash. The URL string should be site-relative.
  • languageId
    Type: System.UInt32
    An unsigned 32-bit integer that specifies the locale ID.
  • webTemplateName
    Type: System.String
    Represents the site definition.

Return Value

Type: Microsoft.SharePoint.Publishing.PublishingWeb
A child PublishingWeb object based on the specified Web template.

Exceptions

Exception Condition
[System.ArgumentNullException]

The parameter cannot accept a a null reference (Nothing in Visual Basic) value.

Remarks

This method determines if the new Web site has PublishingWeb object support. If not, this method activates the appropriate publishing features to make the newly created Web site a PublishingWeb object.

See Also

Reference

PublishingWebCollection Class

PublishingWebCollection Members

Add Overload

Microsoft.SharePoint.Publishing Namespace