Pcdgetstream – Kofax DM API User Manual

Page 79

Advertising
background image

DM API O

BJECTS

59

PCDGetStream

lngCurCount = 0

lngTotCount = 0


'Set our library

objDOC.SetProperty "%TARGET_LIBRARY", bstrLib


'Set the DST.

objDOC.SetDST bstrDST


'Set the Form (here the Default Profile Form).

objDOC.SetObjectType "DEF_PROF"


'Get the document.

objDOC.SetProperty "%OBJECT_IDENTIFIER", _

bstrDocNum

objDOC.Fetch

If objDOC.ErrNumber <> 0 Then

' Error occurred during Fetch. Process it.

End If


'Create/Set-up object to get the document.

Dim objGetDoc As New PCDGetDoc

objGetDoc.SetDST bstrDST

objGetDoc.AddSearchCriteria "%TARGET_LIBRARY", _

bstrLib

objGetDoc.AddSearchCriteria "%DOCUMENT_NUMBER",
_

bstrDocNum

objGetDoc.AddSearchCriteria "%VERSION_ID", _

bstrVerNum

objGetDoc.Execute

If objGetDoc.ErrNumber <> 0 Then

' Error occurred: Process it.

End If


Set objGetStream = _

objGetDoc.GetPropertyValue("%CONTENT")

bytInArray() = objGetStream.Read(5120)

lngCurCount = objGetStream.BytesRead


While ((objGetStream.ErrNumber <> 0) And _

lngCurCount > 0))

Advertising