Document objects, 20 c – Kofax DM API User Manual

Page 40

Advertising
background image

20

C

HAPTER

1

Document Objects

Dim doc As New PCDDocObject

If docnumber = "" Or versionid = "" Then

MsgBox "Check In requires that you set " _

& "the document number and " _

& "the version ID."

Exit Sub

End If

doc.SetDST DST

doc.SetObjectType "cyd_defprof"

doc.SetProperty "%TARGET_LIBRARY", library

doc.SetProperty "%OBJECT_IDENTIFIER", docnumber

doc.SetProperty "%VERSION_ID", versionid

doc.SetProperty "%STATUS", "%UNLOCK"

doc.Update

'Check for error.

Dim lngENum As Long

lngENum = doc.ErrNumber

If lngENum <> 0 Then

Dim strEDesc As String, strENum As String

strEDesc = doc.ErrDescription

strENum = CStr( lngENum )

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

'Handle the error...

End If

Set doc = Nothing

Set doc = New PCDDocObject

doc.SetDST DST

doc.SetObjectType "cyd_defprof"

doc.SetProperty "%TARGET_LIBRARY", library

doc.SetProperty "%OBJECT_IDENTIFIER", docnumber

doc.Fetch

'Check for error.

Dim lngENum As Long

lngENum = doc.ErrNumber

If lngENum <> 0 Then

Dim strEDesc As String, strENum As String

strEDesc = doc.ErrDescription

strENum = CStr( lngENum )

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

'Handle the error...

End If

Advertising