Greetings fellow VSTO'ers,
I have a Word Template which uses an Assembly Customization. One of the controls that I have is a command bar which includes several buttons. Each of these buttons spawn a System.Windows.Form, which prompts the user for data; once the data is confirmed, interOP code manipulates the word document accordingly.
An example of the word manipulation code behind one of the buttons is:
...
Globals.ThisDocument.ReportCoverDateNode.Text = selectedDate.ToString("MMMM d, yyyy");
...
When I open 1 document that uses this template all is well; and the buttons work fine and modify the 1 open document. However, when I open more than 1 document at the same time that use this template, I am running into issues. The customization seems to load fine for all subsequent documents, however when I click on a button in the commandbar, the resulting interOP manipulation only affects the very first document.
It seems like each document is opening on the same thread? How do I resolve this problem so that multiple documents using the same assembly customization can be open at the same time?
Thanks in advance!