Quantcast
Channel: Windows Desktop Development for Accessibility and Automation forum
Viewing all articles
Browse latest Browse all 585

How to trap PowerPoint Close event

$
0
0

Hello,

I use the Reflection to subscribe the events from PowerPoint as below:

EventInfo eInfo = m_powerPoint.GetEvent(_eventName);
            if (eInfo != null)
            {
                Type handlerType = eInfo.EventHandlerType;
                MethodInfo method = this.GetType().GetMethod(_funcName, BindingFlags.NonPublic | BindingFlags.Instance);

                Delegate handler = Delegate.CreateDelegate(eInfo.EventHandlerType, this, method);
             
                
                eInfo.AddEventHandler(m_PowerPointObject, handler);
                return handler;
            }

It is working fine, however, I am facing the problem that I can not catch the Close event from PowerPoint, then I do not release by calling  eInfo.RemoveEventHandler(m_PowerPointObject, _handler);.

That's why the PowerPoint could not be shutdown. 

Does anyone know how we can trap the close event?

Thanks.


Viewing all articles
Browse latest Browse all 585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>