Geeks With Blogs
Early Frost of Our Discontent Dave Yasko

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 on Tuesday, August 5, 2008 4:50 PM VSTO , .NET | Back to top


Comments on this post: Word's "Show All Windows in Taskbar" problems

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Dave Yasko | Powered by: GeeksWithBlogs.net