Word's "Show All Windows in Taskbar" problems

So, I'm writing a VSTO 3.0 Word application level add-in, and I want a custom task pane to show for some documents but not for others.  Should be easy to do, right?  Not so much.  First, I create an extension method for the Microsoft.Office.Interop.Word._Document class that examines the properties of the document that I'm using for the show/hide behavior.  So far, real simple.  Then, I add an event handler to the Microsoft.Office.Interop.Word.Application.DocumentChange event in which I call the exention method on the current document and set the custom task pane's visibility appropriately.  Done, right?

WRONG!!!

This logic only works if the Application.ShowWindowsInTaskbar property is set to false.  Once Word is set to show all the windows in the taskbar ("Show all windows in the Taskbar" advanced display option checked), Word does something to the custom task pane.  Attempting to set its visibility throws a nasty COM exception.

I'm trying to work around this, perhaps by having my add-in recreate its custom task pane, but only time will tell.

Dave

Update - The throwing of the COM exception is not consistent.  :(

«August»
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456