Document objects, 24 c – Kofax DM API User Manual

Page 44

Advertising
background image

24

C

HAPTER

1

Document Objects

Set pclient = _

CreateObject("PCDClient.PCDSearch")

pclient.SetDST DST

pclient.AddSearchLib library

'This example uses the "def_qbe" form.

pclient.SetSearchObject "def_qbe"

'Set the properties to be returned. These

'are the properties to be displayed in the

'search results page.

pclient.AddReturnProperty("DOCNAME")

pclient.AddReturnProperty("DOCNUM")

pclient.AddReturnProperty("AUTHOR_ID")

pclient.AddReturnProperty("STATUS")

pclient.AddReturnProperty("VERSION")

pclient.AddReturnProperty("SECURITY")

pclient.AddReturnProperty("VERSION_ID")

pclient.AddOrderByProperty "VERSION_ID", True

pclient.AddSearchCriteria "DOCNUM", docnumber

pclient.Execute

'Check for error.

Dim lngENum As Long

lngENum = pclient.ErrNumber

If lngENum <> 0 Then

Dim strEDesc As String, strENum As String

strEDesc = pclient.ErrDescription

strENum = CStr( lngENum )

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

'Handle the error...

End If

docsfound = pclient.GetRowsFound

txtDocsFound = Str(docsfound)

If docsfound = 0 Then

Set pclient = Nothing

Exit Function

End If

pclient.NextRow

DefaultRights = _

pclient.GetPropertyValue("SECURITY")

DocName = pclient.GetPropertyValue("DOCNAME")

Advertising