CheckOut method

CheckOut method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

See also         Example         Applies to

Marks a specified document as checked out and assigns edit privileges to the current user.

Version added

2002 SR-1

Syntax

        
          object.CheckOutfileName
      

object

Required. An expression that returns a Documents collection.

fileName

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

Remarks

Files must be stored in enhanced folders on a Microsoft SharePoint Portal server to use the CheckIn and CheckOut methods.

Unlike the behavior in the user interface, the CheckOut method does not open the document. Use the Open method to open the document in the drawing window after checking it out.

Example

This example verifies that a document can be checked out. If it can, this example checks it out; otherwise, it returns a message that the document cannot be checked out.

  Sub CheckDocOut(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 preceding CheckDocOut subroutine, use the following subroutine and replace the "http://servername/workspace/drawing.vdx" file name with an actual file located in an enhanced folder on a Microsoft SharePoint Portal server.

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