Pcdputdoc, Dm api o – Kofax DM API User Manual

Page 119

Advertising
background image

DM API O

BJECTS

99

PCDPutDoc

objPutDoc.AddSearchCriteria _

"%TARGET_LIBRARY", Library

objPutDoc.AddSearchCriteria _

"%DOCUMENT_NUMBER", DocNumber

objPutDoc.AddSearchCriteria "%VERSION_ID", _

VersionID

objPutDoc.Execute

If objPutDoc.ErrNumber <> 0 Then

Debug.Print objPutDoc.ErrNumber, _

objPutDoc.ErrDescription

Exit Sub

End If

objPutDoc.NextRow

Dim objPutStream As Object

Set objPutStream = _

objPutDoc.GetPropertyValue("%CONTENT")

Dim FileName

FileName = txtFileName.Text

Debug.Print "File Name: ", FileName

Open FileName For Binary Access Read As #1

TotalFileSize = LOF(1)

While (Not EOF(1))

TotalBytesWritten = TotalFileSize

If TotalBytesWritten > 0 Then

'If you want to use Ubound, then you have

'to increment the reads correctly. The

'previous code read each successive group

'of bytes and skipped the byte between the

'reads. This occurred due to the way in

'which VB reads binary data. (Read about

'the Get method.)

If (TotalBytesWritten > UBound(bdata)) Then

TotalBytesWritten = UBound(bdata) + 1

'The +1 was added because this only gets

'called on successive reads, and not the

'first read.

Advertising