Pcdgetdoc – Kofax DM API User Manual

Page 73

Advertising
background image

DM API O

BJECTS

53

PCDGetDoc

Example

The following example shows you can use PCDGetDoc to retrieve the
name of a file that contains a document in your DM repository.

.

.

.

Dim objGetDoc As New PCDGetDoc

objGetDoc.

SetDST

strDST

objGetDoc.

AddSearchCriteria

_

"%TARGET_LIBRARY", strLib

objGetDoc.

AddSearchCriteria

_

"%DOCUMENT_NUMBER", strDocNum

objGetDoc.

AddSearchCriteria

_

"%VERSION_ID", strVersionID


objGetDoc.

Execute

If objGetDoc.

ErrNumber

<> 0 Then

'Error occurred.

End If


Dim lngRowCount As Long

Dim strFileName As String

'Dim bdata() As Byte

'Dim indata As Variant


lngRowCount = objGetDoc.

GetRowsFound

If objGetDoc.

ErrNumber

<> 0 Then

'Error occurred.

End If

If lngRowCount <> 1 Then


'Possible Error. Only 1 file expected.

Else

objGetDoc.

SetRow

( 1 )

strFileName = objGetDoc.

GetPropertyValue

( _

PATH )

MsgBox “The name of the document is: “ & _

strFileName

EndIf

.

Advertising