1
votes

I've developed an application-level add-in for Word, and encountered the following problem:

When another document is opened (and another Word Window appears), I cannot use the Add-In in the newly-opened window. Moreoever, when I click the button in the Ribbon that should display the Add-In, it's getting displayed in the original window, and not the new one.

How can I make the Add-In appear also in the new Window?

Thanks!

UPDATE: After realizing the question was not clear enough, let me clarify:

The Add-In displays custom task pane. What happens is that when I open a new window of Word, the button that displays / hide the pane affects only the original window, and not the new one, so I cannot display two instances of the task pane.

Why is that? How can I display multiple task panes in Word?

1
whats your VSTO Version? WORD target version? VS Version?RadioSpace
so I created a word add-in (2013) and put a button in a ribbon and the click event simply has Globals.ThisAddIn.Application.ActiveDocument.Content.InsertAfter("yes"); which successfully adds text to the appropriate window. so maybe if you could share the code you are calling the add-in that appears. I could help moreRadioSpace
OK, I just realized my question was not clear enough... What I meant is that my Add-In displays a custom task pane. When I open a new window in Word, I cannot open the pane in the newly-opened window, just in the original one. I'll update the question.ml123

1 Answers

0
votes

That's becuase TaskPane is document bound object. If you create your TaskPane in Addin_Startup it will be bound to the active document. While having two instances od Word Document, you have that Active document still opened, so any button on Ribbon (which is shared between instances) will only affect that first window.

The solution is problably to create multiple TaskPanes for multiple documents, but that's kinda ghetto solution.