Export images to multi-TIFF format

The following example subscribes to the InvoiceInterpreted event and exports a multi-TIFF file when the event is fired.

Public Function Connect(oEHIApp As Object, sIniFile As String, sIniSection As String) As Long

   Set m_oEHOLEAPP = oEHIApp.GetClassicObject

   Set m_oEHCOMAPP = oEHIApp

   

   Dim iRet As Long

   iRet = m_oEHOLEAPP.Subscribe(Me, "InvoiceInterpreted", "OnInvoiceInterpreted")

  

   Connect = 0

End Function

Public Function OnInvoiceInterpreted() As Long

   ExportToMultiTiff

   OnInvoiceInterpreted = evtOK

End Function

Private Sub ExportToMultiTiff()

   Dim obInvoice As EHICOM.Invoice

   Set obInvoice = m_oEHCOMAPP.CurrentInvoice

      

   Dim sTiffname As String

   sTiffname = "C:\temp\" & GetMtiffFileName

   obInvoice.ExportToMultiTiff sTiffname

End Sub

Private Function GetMtiffFileName() As String

   Dim s As String

   s = Now()

   s = Replace(s, ":", "")

   s = Replace(s, "-", "")

   s = s & ".tif"

   GetMtiffFileName = s

End Function

Related topics