ADXCustomTaskPaneInstance Cast

Add-in Express™ Support Service
That's what is more important than anything else

ADXCustomTaskPaneInstance Cast
 
Joe Lutz




Posts: 23
Joined: 2007-12-03
I'm able to get a reference to my CustomTaskPane by doing AddinModule.CurrentInstance.TaskPanes[<Index>][<Inspector>] which returns to me an ADXCustomTaskPaneInstance. My problem is that I need to add an event handler for VisibleStateChange which is an event on ADXCustomTaskPane but for one reason or another seems to be missing from ADXCustomTaskPaneInstance. I'm having trouble figuring out how I can cast my ADXCustomTaskPaneInstance to an ADXCustomTaskPane.
Posted 04 Dec, 2007 13:57:34 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Joe.

Please use the VisibleStateChange event of the ADXTaskPane component (an item of the TaskPanes collection). It contains the 'taskPaneInst' parameter.
Posted 05 Dec, 2007 07:44:20 Top
Joe Lutz




Posts: 23
Joined: 2007-12-03
Yeah I finally just figured out that I could use .Parent on the ADXCustomTaskPaneInstance object and that had the VisibleStateChange event. Thanks.
Posted 05 Dec, 2007 10:28:13 Top
Joe Lutz




Posts: 23
Joined: 2007-12-03
What can I cast the 'taskPaneInst' parameter to?
I've tried a bunch of things but I always get this:
Cannot cast 'taskPaneInst' (which has an actual type of 'System.__ComObject') to '(my type)'

I've tried ADXTaskPane, ADXCustomTaskPane, ADXCustomTaskPaneInstance... no luck :/
Posted 05 Dec, 2007 18:36:08 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Joe.

You can cast the 'taskPaneInst' to Microsoft.Office.Core.CustomTaskPane type.
Posted 06 Dec, 2007 10:07:26 Top