Creating and registering an external event server object

The following code example is for an event handler that creates an instance of the event server object, connects to it, informs ReadSoft Invoices that the object is an event server, and finally saves it globally so that the handler for the JobStopped event can access the object.

The code must be inserted into ReadSoft Invoices at the application level. Select JobStarted as the New event and enter the code using the Visual Basic window.

The event handler is called when a job is started, before any invoices have been processed.

Function OnJobStarted ( ) As Long

Dim ExtServObj As Object

Set ExtServObj = CreateObject("EHISample.EventServer")

Call ExtServObj.Connect(Application, "C:\DB\Sample.mdb")

Call Application.SetEventServerObject(ExtServObj)

Call Application.SetSharedObject("EHIExtServObj", ExtServObj)

OnJobStarted = EV_OK 'return value to Kofax ReadSoft Invoices

End Function

Related topics

Back to instructions

Overview of example