Lists.CheckOutFile Method
Allows documents in a SharePoint document library to be checked out remotely.
Namespace: [Lists Web service]
Web service reference: http://Site/_vti_bin/Lists.asmx
Syntax
'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/CheckOutFile", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/", _
ResponseNamespace := "https://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
'Usage
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("https://schemas.microsoft.com/sharepoint/soap/CheckOutFile", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/",
ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public bool CheckOutFile(
string pageUrl,
string checkoutToLocal,
string lastmodified
)
Parameters
pageUrl
Type: System.StringA string that contains the full path to the document to be checked out.
checkoutToLocal
Type: System.StringA string containing "true" or "false" that designates whether the file is to be flagged as checked out for offline editing.
lastmodified
Type: System.StringA 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
Type: System.Boolean
true if the operation succeeded; otherwise, false.
Examples
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");