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.  :(

posted @ Tuesday, August 05, 2008 4:50 PM

Print

Comments on this entry:

No comments posted yet.

Your comment:



 (will not be displayed)


 
 
 
 

Live Comment Preview:

 
«July»
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678