The inability of IMessageFilter to process 0x800AC472 (VBA_E_IGNORE) makes the implementation of IMessageFilter irrelevant?

From msdn, it seems that it IMessageFilterdoes not handle all exceptions, for example, in some cases, the suspension of office applications is their object model, at this point it cannot be called and thrown:0x800AC472 (VBA_E_IGNORE)

To get around this, you must put your call in a loop and wait for its success:

while(true)
{
    try
    {
        office_app.DoSomething();
        break;
    }
    catch(COMException ce)
    {
        LOG(ce.Message);
    }
}

My question is: if this boiler plate code is needed for every call to the office application object model, is there any point in the implementation IMessageFilter?

+5
source share
1 answer

, . IMessageFilter - COM- COM, 60 . VBE_E_IGNORE Excel , , . , , Excel , , . , . , IMessageFilter, . VSTO MSDN.

, , . , , Excel , , . Excel , , , , Excel .

+6

All Articles