CheckinCheckOut

This function is used to perform check-in/ check-out operations on the document and allows to change the image of document through check in operation.

CheckinCheckOut(ByVal CheckInCheckOutFlag As String,ByVal LimitCount As Long,ByVal AnnotVersions As String,ByRef lDocCount As Long,ByRef Documents() As Byte,ByRef FileNames() As String,ByRef lFailedDocCount As Long,ByRef FailedDocs() As Byte) As Long

 

Parameters

In/out

Name

Data type

Description

In   

 

CheckInCheckOutFlag

String

'Y' for check out, 'N' for check in and 'U' for undo checkout

In

LimitCount

Long  

Limit count set for check in/out 

In

AnnotVersions

String

'Y' to enable auto versioning while checking In and checking out else set as 'N' 

In

 

ldocCount

Long

Total documents to be Checked In/Checked Out

In/Out

 

Documents

Byte[TagDocument]

Byte array specifying the attributes of the document

In  

 

FileNames

String

Name of file to be checked in

Out

lfailedDocCount

Long

Document count which could not be checked In/out

Out

 

FailedDocs

Byte

Byte array specifying list of documents which could not be checked In/out

 

Description

This function is only present in shared cabinet. It is called when any document is either checked in or checked out.

Pass parameter Y in 'CheckinCheckoutFlag'  to checkout the document and ‘N” to check-in the document .In case of check-in pass filename to change the image of document. It returns the failed document list that were unable to be checked in or checked out.

 

Return value

Name

Description

 1

In case of success

-3

Cabinet not connected

-4

Invalid operation

-201

 

Insufficient rights for the current operation

-133

 

User not logged in

 

Example

 Dim CheckInCheckOutFlag           As String

 Dim LimitCount                             As Long

 Dim AnnotVersions                       As String

 Dim lDocCount                             As Long

 Dim Document()                           As Byte

 Dim  FileNames()                         As String

 Dim lFailedDocCount                    As Long

 Dim FailedDocs()                         As Byte

 Dim  DocInfo                               As TagDocument

 Dim lRetVal                                 As Long

 Dim gPDb                                   As PanDb.pdbCls


    Set gPDb = New PanDb.pdbCls

    DocInfo.DocumentId = 12          

    DocInfo.FolderId = 54

    DocInfo.NoOfPages = 1

    DocInfo.Owner  = 8

    DocInfo.DataDefId   = 0

    DocInfo.DocumentSize  = 123

    DocInfo.FTSDocId  = 0

    DocInfo.AccessType = “I”

    DocInfo.DocType  = “txt”

    DocInfo.ExpiryDateTime = “11/13/12 1:00:05 PM”

    DocInfo.DocName  = “mydoc”

    DocInfo.Author = “Nikesh”

 

    CheckInCheckOutFlag = “Y”   'for checking out a document

    LimitCount = 50

    AnnotVersions = "N"  ' to disable autoversioning while performing checking out/checking in

    lDocCount  = 1

 

    ReDim Document(Len(DocInfo)  - 1)

    Call CopyMemory(Document(0), DocInfo(0), Len(DocInfo))         

 

    ReDim FileNames(0)

    FileNames(0) = "C:\abc.doc"

     lRetVal=gPDb.CheckinCheckOut(CheckInCheckOutFlag,LimitCount,AnnotVersions,lDocCount,Document,FileNames,lFailedDocCount,FailedDocs)

if lRetVal <> NG_SUCCESS Then

       MsgBox gPDb.ErrDescription, vbInformation

       Screen.MousePointer = vbNormal

       Exit Sub

End If