none
How to trap PowerPoint Close event

    Question

  • 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.

    Tuesday, June 11, 2013 10:06 AM