Hi

I am using NetOffice and Visual Studio 2010 Express to develop word COM addins.

Very simple I want to show a custom task pane (CTP) when a check box is ticked in the ribbon UI.

NetOffice cannot directly using the standard custom task pane objects that are available in the visual studio express. It has to rely on CTPFactoryAvailable method to show the CTP.

The following example shows the CTP upon loading up word however I cannot make it more dynamic to only show the CTP when the checkbox is ticked.

Does anyone have any ideas?

Adding the ICustomTaskPaneConsumer to the Implements
Office.ICustomTaskPaneConsumer

And use the CTPFactoryAvailable sub to create the custom task pane.

Public Sub CTPFactoryAvailable(ByVal CTPFactoryInst As Object) Implements NetOffice.OfficeApi.ICustomTaskPaneConsumer.CTPFactoryAvailable
Dim ctpFactory As Office.ICTPFactory = New Office.ICTPFactory(_wordApplication, CTPFactoryInst)
Dim taskPane As Office._CustomTaskPane = ctpFactory.CreateCTP(GetType(Addin).Assembly.GetName().Name + ".SampleControl", "NetOffice Sample Pane(VB4)", Type.Missing)
taskPane.DockPosition = MsoCTPDockPosition.msoCTPDockPositionLeft
taskPane.Width = 300
taskPane.Visible = True
_sampleControl = taskPane.ContentControl