task Panes

S

slaprade

I am using VSTO2005SE with Word 2007 and VS.net Visual Basic. I am having
trouble adding a custome task pane.

I have added the following to my code
Public Sub ShowMTP(ByVal Ctrl As IRibbonControl)
Dim NUC2 As New UC2
MsgBox("gothere")
MsgBox(Me.CTPs.Count)
MTP = Me.CTPs.Add(NUC2, "Test")
MTP.Visible = True


and this derfinition
Public WithEvents CTPs As New
Microsoft.Office.Tools.CustomTaskPaneCollection

I have added the following references
Microsoft.Office.Core
Micorsoft.office.interop.word
Micorsoft.Office.Tools.Common2007
stdole

I have the following in my ribbon cml
button id="buttTaskPane" label="Show TaskPane"
screentip ="Show Style for current IP"
size="normal" onAction="ShowMTP" />


When I execute to ribbon button I get the first msg and then a msg
Cannot access a disposed object

Anyone have any ideas?
 
S

slaprade

I need to add that created my project as a shared addin as opposed to an Word
2007 solution.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top