SPFile.CheckOut method (Boolean, String)

Checks out the file from a document library by specifying whether to check out the file to the local computer 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)

Syntax

'Declaration
Public Sub CheckOut ( _
    checkOutToLocal As Boolean, _
    lastModifiedDate As String _
)
'Usage
Dim instance As SPFile
Dim checkOutToLocal As Boolean
Dim lastModifiedDate As String

instance.CheckOut(checkOutToLocal, lastModifiedDate)
public void CheckOut(
    bool checkOutToLocal,
    string lastModifiedDate
)

Parameters

  • checkOutToLocal
    Type: System.Boolean

    true to check out the file locally; otherwise, false.

  • lastModifiedDate
    Type: System.String

    A string that contains a date. If specified, you can only check out the file if the date on which the file was last modified matches the date that is specified in this parameter.

Remarks

If the value of the CheckOutType property is equal to None, the checkout depends upon the value of the checkOutToLocal parameter. If the value of the checkOutToLocal parameter is true, this method calls CheckOut(SPFile.SPCheckOutType, String) with Offline and lastModifiedDate, otherwise it calls CheckOut(SPFile.SPCheckOutType, String) with Online and lastModifiedDate.

If the value of the CheckOutType property is not equal to None, this method reconciles the values of the CheckOutType property and the checkOutToLocal parameter to check out the file.

See also

Reference

SPFile class

SPFile members

CheckOut overload

Microsoft.SharePoint namespace