Share via


SPFile.Publish method

Submits the file for content approval with the specified comment.

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

Syntax

'Declaration
Public Sub Publish ( _
    comment As String _
)
'Usage
Dim instance As SPFile
Dim comment As String

instance.Publish(comment)
public void Publish(
    string comment
)

Parameters

  • comment
    Type: System.String

    A string that contains the comment.

Exceptions

Exception Condition
SPException

The list item associated with the file is null or the SPList in which the list item locates does not support minor versions.

-or-

The value of the CheckOutType is Online.

-or-

An error occurred when publishing the file.

Remarks

To call this method, the parent SPList of this file should support minor versions.

See also

Reference

SPFile class

SPFile members

Microsoft.SharePoint namespace