COM callback

  • Thread starter Jonas Mandhal Pedersen
  • Start date
J

Jonas Mandhal Pedersen

Hi

I am activating ms Word trough COM interfaces.
How is it possible to define a callback function so I can recive information
of when the user close word ?

Jonas
 
P

Peter Hewett

Hi Jonas

As long as you're using early binding to start Word you should be able to use
Words Application Quit event. Event sink/listener procedures need to be in a
class module, so in your class module you'll have something like this:

Public WithEvents WordApp As Word.Application

Private Sub Class_Initialize()
Set WordApp = New Word.Application
End Sub

Private Sub WordApp_Quit()
' Do whatever you want here
End Sub

HTH + Cheers - Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top