Share via


CanCheckOut Method [Visio 2003 SDK Documentation]

Specifies whether a document can be checked out from a Microsoft SharePoint Portal Server computer.

boolRet = object**.CanCheckOut** (fileName)

boolRet     Boolean. True (non-zero) if the document can be checked out; otherwise, False (zero).

object     Required. An expression that returns a Documents collection.

fileName     Required String. The server path and name of the file.

Version added

2002 SR-1

Remarks

You cannot check out a file that is already checked out, or is not stored in an enhanced folder on a Microsoft SharePoint Portal Server computer.

Example

This example verifies that a document is not checked out by another user and that it can be checked out.

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

    

To call the preceding CheckDocOut subroutine, use the following subroutine and replaceservername/workspace/drawing.vdx with the path to and name of an actual file located in an enhanced folder on a Microsoft SharePoint Portal Server computer.

Sub DocOut() 
    Call CheckDocOut _ 
        (strDocCheckOut:="http://servername/workspace/drawing.vdx") 
End Sub  

Applies to | Documents collection

See Also | CanCheckIn method | CheckIn method | CheckOut method