I want create a custom task pane that users can hide or display by clicking a toggle button on the Ribbon. You should always create a user interface (UI) element, such as a button, that users can click to display or hide your custom task pane, because Microsoft Office applications do not provide a default way for users to show or hide custom task panes.
Software Used:
.net 2.0 and c#,Vsto
Can u give the Steps For that
Mujeeb RahmanPosted Mar 23, 2010, 4:56 AM
From visual studio 2008 you can easily create a custom task pane
1. Create Excel/Word Add-In Project
2. Add a user control (UserControl1.cs) to the project
3. Open ThisAddIn.cs project
4. Add the following code
namespace ExcelAddInCustomTab
{
public partial class ThisAddIn
{
public CustomTaskPane ctp;
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
UserControl1 TPControl = new UserControl1();
ctp = CustomTaskPanes.Add(TPControl, "my CTP");
ctp.Visible = true;
}
}
}
And also Add the following code in toggle Button click event for hiding and displaying Custom Task Pane