Advanced task panes not working correctly on PowerPoint 2010

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

Advanced task panes not working correctly on PowerPoint 2010
Task panes are not hidded correctly on startup and closing them manually hides PowerPoint 
momsoft




Posts: 79
Joined: 2004-06-16
Advanced task panes work differently on PowerPoint 2007 and 2010. I hide them when PowerPoint starts using the following code on the AddInModuleAddInStartupComplete event:

var
Current : TadxPowerPointTaskPane;


begin
...
Current := tpPane.TaskPaneInstance;
if Assigned(Current) then Current.Hide;
...
end;

I use the same code to programatically hide the task pane when the user clicks a button.

On PowerPoint 2007 everything works as intended, on PowerPoint 2010 the task pane is not hidden on startup, and most times the PowerPoint window (not the task pane but the application window) is hidden. Relaunching PowerPoint shows the window again.

I am using the latest beta version of ADX2010.
Posted 28 Jun, 2010 15:44:41 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hi Manuel,

We will check why the PowerPoint application window hides. But I don't think your approach is correct because there's no guarantee that the task pane will be shown by the time you get AddinStartupComplete. Moreover, because Excel and Word demonstrates different load order when you start them via the Start menu or by double-clicking a file on the Desktop, I suspect PowerPoint does the same sort of things. Plus, I wouldn't be surprised that the load order differs in Office 2010 (when comparing with any other Office version).

I suggest that you set self.Visible := false in the ADXBeforeTaskPaneShow event of the task pane class. Also, you can set Args.Cancel := true in the ADXBeforeTaskPaneInstanceCreate event of the task panes manager.


Andrei Smolin
Add-in Express Team Leader
Posted 29 Jun, 2010 03:30:53 Top
momsoft




Posts: 79
Joined: 2004-06-16
Hi Andrei,

Thank you very much for your quick response. I understand your point but the truth is that my method worked for all versions of PowerPoint before 2010.

I have proceed as you suggest and task panes are not shown on startup, but I seem they are not shown either afterward. What I have done is as follows:

On a shared unit:

var
Starting : Boolean = True;

On the ADXBeforeTaskPaneShow event:

if Starting then Self.Visible := False;

At the end of the AddinStartupComplete:

Starting := False;

To hide or show the Task Pane:

Current := tpPane.TaskPaneInstance;
if Assigned(Current) then
Current.Hide; // or Current.Show to show the task pane

Also note that if I set Args.Cancel := true in the ADXBeforeTaskPaneInstanceCre ate event of the task panes manager as per your suggestion, the task pane is never created and therefore can't be shown.

I think I have it working now. I still have to try it on PowerPoint 2003 and 2010 but I guess it will also work as it does on PowerPoint 2007.

Thank you very much,

- Manuel
Posted 29 Jun, 2010 16:11:48 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hi Manuel,

OK. Don't hesitate to ask if you run into a problem.


Andrei Smolin
Add-in Express Team Leader
Posted 30 Jun, 2010 03:21:48 Top