SPFile.CheckOut method (SPFile.SPCheckOutType, String)

SharePoint 2013

Checks out the file from a document library by specifying the type of checkout and by specifying that the file should not be checked out if it has been modified after a particular date.

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

public void CheckOut(
	SPFile.SPCheckOutType checkOutType,
	string lastModifiedDate
)

Parameters

checkOutType
Type: Microsoft.SharePoint.SPFile.SPCheckOutType

One of the enumeration values that specifies the type of checkout.

lastModifiedDate
Type: System.String

The date when the file was last modified; can be a null reference (Nothing in Visual Basic).

ExceptionCondition
SPFileCheckOutException

checkOutType is None.

SpException

The lastModifiedDate parameter is not null and the value does not match the value of the TimeLastModified property, which is when the file was last modified.

-or-

An error occurred while checking out the file.

Show: