Lists.CheckOutFile Method

Allows documents in a SharePoint document library to be checked out remotely.

Web Service: ListsWeb Reference: http://<Site>/_vti_bin/Lists.asmx

Syntax

<SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/CheckOutFile", RequestNamespace:="http://schemas.microsoft.com/sharepoint/soap/", ResponseNamespace:="http://schemas.microsoft.com/sharepoint/soap/", Use:=SoapBindingUse.Literal, ParameterStyle:=SoapParameterStyle.Wrapped)> _
Public Function CheckOutFile ( _
    pageUrl As String, _
    checkoutToLocal As String, _
    lastmodified As String _
) As Boolean

Dim instance As Lists
Dim pageUrl As String
Dim checkoutToLocal As String
Dim lastmodified As String
Dim returnValue As Boolean

returnValue = instance.CheckOutFile(pageUrl, checkoutToLocal, lastmodified)
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/CheckOutFile", RequestNamespace="http://schemas.microsoft.com/sharepoint/soap/", ResponseNamespace="http://schemas.microsoft.com/sharepoint/soap/", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)] 
public bool CheckOutFile (
    string pageUrl,
    string checkoutToLocal,
    string lastmodified
)

Parameters

  • pageUrl
    A string that contains the full path to the document to be checked out.
  • checkoutToLocal
    A string containing "true" or "false" that designates whether the file is to be flagged as checked out for offline editing.
  • lastmodified
    A string in RFC 1123 date format representing the date and time of the last modification to the file; for example, "20 Jun 1982 12:00:00 GMT".

    Note

    If this parameter contains a value, the server compares the submitted lastModified value with the stored lastModified value. If the values do not match, the check-out fails and this method returns false.

Return Value

true if the operation succeeded; otherwise, false.

Example

The following example checks out a file from Shared Documents in a subsite.

Dim listService As New Web_Reference_Folder.Lists()
listService.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim fileCheckout As String = "http://Server_Name/sites/Subsite/Shared Documents/MyFile.txt"
Dim myResults As Boolean = listService.CheckOutFile(fileCheckout, "true", "20 Jun 2006 12:00:00 GMT")
Web_Reference_Folder.Lists listService = new Web_Reference_Folder.Lists();

listService.Credentials = System.Net.CredentialCache.DefaultCredentials;

string fileCheckout = "http://Server_Name/sites/Subsite/Shared Documents/MyFile.txt";

bool myResults = listService.CheckOutFile(fileCheckout, "true", "20 Jun 2006 12:00:00 GMT");

See Also

Reference

Lists Class
Lists Members
Lists Web Service