Add pane to specific window (Word / Excel)

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

Add pane to specific window (Word / Excel)
Charles Mager

Posts: 39
Joined: 2014-08-06
I have a requirement to load panes that are related to a specific document - one document might not have any panes, the other might). I've mainly got this to work in both Word and Excel as so:

- I handle the ADXBeforeTaskPaneInstanceCreate and cancel it unless I'm adding a pane (this prevents an existing pane loading on a new Window).
- When I want to add a pane, I add a XTaskPanesCollectionItem to TaskPanesManager.Itemss and call CreateTaskPaneInstance (Excel) or ShowTaskPane (Word).

This sort-of-works. Except I have a long-ish running process (10-20 seconds) that I have to do before I can load these panes. During this time, the user can change from one Document or Workbook to another. The process I described above will only add a pane to the *active* window. Is there any way I can have control over which window to add the panes to?
Posted 16 Sep, 2015 11:07:55 Top
Andrei Smolin

Add-in Express team

Posts: 16080
Joined: 2006-05-11
Hello Charles,

ADXBeforeTaskPaneInstanceCreate prevents the creation of a task pane instance.

You need to handle the ADXBeforePaneShow event of the task pane class. Setting the Visible property of the task pane instance to false in this event prevents the pane from showing.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 17 Sep, 2015 06:00:20 Top