Document objects, 26 c – Kofax DM API User Manual

Page 46

Advertising
background image

26

C

HAPTER

1

Document Objects

GetTrusteesforProfile = True

Exit Function

End If

ErrorHandler:

MsgBox "Unhandled Error: " & _

Str(Err.Number) & " was generated by " _

& Err.Source & Chr(13) & Err.Description

End Function

.

.

.

Private Sub cmdAddTrustee_Click()

'Two ways to do this:

'1) Set trustee on profile object and

' update trustees.

Set PDoc = _

CreateObject("PCDClient.PCDDocObject")

PDoc.SetDST DST

PDoc.SetProperty "%TARGET_LIBRARY", library

PDoc.SetObjectType("DEF_PROF")

PDoc.SetProperty "%OBJECT_IDENTIFIER", docnumber

PDoc.FetchTrustees

'Set flags to 1 for group and 2 for user, but

'0 may work.

PDoc.SetTrustee cboTrustees.Text, 2, _

Val(txtRights)

'Check for error.

Dim lngENum As Long

lngENum = PDoc.ErrNumber

If lngENum <> 0 Then

Dim strEDesc As String, strENum As String

strEDesc = PDoc.ErrDescription

strENum = CStr( lngENum )

MsgBox "Error " & strENum & ": " & strEDesc

'Handle the error...

End If

PDoc.UpdateTrustees

'Check for error.

Dim lngENum As Long

Advertising