Documents.CanCheckOut method (Word)

True if Microsoft Word can check out a specified document from a server. Read/write Boolean.

Syntax

expression.CanCheckOut (FileName)

expression Required. A variable that represents a Documents object.

Parameters

Name Required/Optional Data type Description
FileName Required String The server path and name of the document.

Return value

Boolean

Remarks

To take advantage of the collaboration features built into Word, documents must be stored on a Microsoft SharePoint Portal Server.

Example

This example verifies that a document is not being edited by another user and that it can be checked out. If the document can be checked out, it copies the document to the local computer for editing.

Sub CheckInOut(docCheckOut As String) 
 If Documents.CanCheckOut(docCheckOut) = True Then 
 Documents.CheckOut docCheckOut 
 Else 
 MsgBox "You are unable to check out this document at this time." 
 End If 
End Sub

To call the CheckInOut subroutine, use the following subroutine and replace the "https://servername/workspace/report.doc" file name with an actual file located on a server mentioned in the Remarks section.

Sub CheckDocInOut() 
 Call CheckInOut (docCheckIn:="https://servername/workspace/report.doc") 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.