UnlockObject

 It is used to unlock object  which are locked.

Public Function UnlockObject(ByVal ObjectId As Long, ByVal VersionNo As Single, ByVal ObjectType As String) As Long

 

Parameters

In/out

Name

Data type

Description

In

 

ObjectId

Long

Index of the object to unlocked

In

VersionNo

Long

Version number of the object

In

ObjectType

String

Specifies the Object type. The object can be document or folder.

 

Description

This function is called to unlock any folder or document which is locked .

Like when we open OmniViewer, document is locked and after closing the OmniViewer ,document should be unlocked.

We can unlock specific versions of document also .

 

Object Type

Passed as “F” for folder and “D” for Document.

 

Return value

Name

Description

1

In case of success

-2

Invalid operation in readonly cabinet

-3

Cabinet not connected

 

Example

    Dim lRetVal                         As Long

    Dim lObjectId                      As Long

    Dim sObjectType                As String

    Dim VersionNo                   As Long

    Dim gPdb                          As  Pandb.Pdbcls

 

    Set gPdb = new Pandb.Pdbcls        ' Create Pandb Object

    VersionNo = 0                    ' for current version of document 

    sObjectType = "D"            

    lObjectId = 4                     ' document id 

   lRetVal = gPdb.UnlockObject(lObjectId, VersionNo, sObjectType)

   If lRetVal <> 1 Then

       MsgBox gPdb.ErrDescription

   Else

       MsgBox " Success – Unlocked  the object "

   End If