Best way to set Advanced Custom TaskPane visible to false by default

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

Best way to set Advanced Custom TaskPane visible to false by default
 
R. Damien




Posts: 10
Joined: 2014-04-28
Hello,

As an alternative to issue http://www.add-in-express.com/forum/read.php?FID=5&TID=12778&MID=65187#message65187,

I'm trying to replace Standard TaskPane by Advanced TaskPane.

Everything seems OK, except the function to hide taskpane by default.

I read different posts as http://www.add-in-express.com/docs/net-outlook-regions-panes-ui.php#hidden but I am not able to auto hide (completely hide, not hidden mode collapsed pane) the advanced task pane.

It's Ok from the ribbon button by playing with visible property and with this code :



private void showhideAdvancedPaneRibbonButton_OnClick(object sender, IRibbonControl control, bool pressed)
{
    if (!adxExcelTaskPanesCollectionItem1.TaskPaneInstance.Visible)
    {
        adxExcelTaskPanesCollectionItem1.ShowTaskPane();
    }
    else
    {
        adxExcelTaskPanesCollectionItem1.CurrentTaskPaneInstance.Hide();
    }
}


But How can Hide CurrentTaskPaneInstance on startup ?

I'am trying to modify adxWordTaskPanesCollection properties without success.

If I play with TaskPane instance event with the following code, I'have a random issue of taskpane instance is Null :


 private void ADXPncTaskPane_ADXBeforeTaskPaneShow(object sender, ADXBeforeTaskPaneShowEventArgs e)
        {       
            if (hideOnActivation)
            {               
                Hide();
                hideOnActivation = false;
            }
        }


I tried other events (AfterTaskPaneShow, Activated, ...) with same issue result.
I saw a similar thread here : http://www.add-in-express.com/forum/read.php?FID=5&TID=11551


EDIT :
like original issue (http://www.add-in-express.com/forum/read.php?FID=5&TID=12778&MID=65187#message65187) , Issue occurs when we open/reopen Word document directly from Windows Explorer with Preview Pane enabled. I recodes my standard task pane addin with Advanced task pane as suggested and finally encountered a similar issue :(
Posted 28 Oct, 2014 06:33:04 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Damien,

But How can Hide CurrentTaskPaneInstance on startup ?


You can handle the ADXBeforeTaskPaneShow event and set the Visible property to False or call the Hide method. As I can see, this is exactly what you do.

If I play with TaskPane instance event with the following code, I'have a random issue of taskpane instance is Null :


Could you please let me know where you are getting null? In which event handler does this issue occur?

I recodes my standard task pane addin with Advanced task pane as suggested and finally encountered a similar issue :(


Yesterday, before suggesting Advanced Task Panes, I tested the scenario you described (Preview Pane is ON, open a document, close it and open the same document anew). I have just retested my project and still cannot reproduce the "double instance" issue with Advanced Word task panes. Please provide more information about the steps that lead to the issue.
Posted 28 Oct, 2014 08:37:40 Top
R. Damien




Posts: 10
Joined: 2014-04-28
Hi Dmitry,

I have just retested my current project but can't reproduce issue with custom task pane, but addin code has evolved since.

I think issue may occur when using AdxTaskPane Load Event to init taskpane. Load Event seems not always called when we use BeforeTaskPaneShow event to initiate taskpane visibility and depending on how we open Word Document.

I fixe issue by not using Load Event to init my taskpane property.

For me, we can close issue.

Thanks,
Posted 31 Oct, 2014 03:42:27 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Damien,

Thank you for keeping us informed.
Posted 31 Oct, 2014 04:23:28 Top