![]() |
|
![]() |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
I am developing an Office Word 2010 Add-In in Visual Studio using c#. In add-in code I have some class level private variables declared.
When a word document is opened then some of these variables are loaded with dynamic values and some are loaded with values in various events like DocumentOpen etc. It's fine till here. Now I keep the first document opened and open another word document. When this second document is opened while debugging before load event I can see the variables are already loaded with the first document's values. So if first document 'Doc1' has a variable named 'docName' which I assign with value "Doc1" when the document is opened. Now when I open another word document 'Doc2' (first document 'Doc1' is still opened, not closed) I see the variable 'docName' already set with value 'Doc1'. This is not only happening when the Documents are opened but in every events all variables' values are shared across multiple documents. I do not want to create variables array as there are many variables and will keep adding more as functionality of add-in is extended. ![]() Any kind of help is highly appreciated. Thanks in advance. Regards, Syed Abbas |
![]() |
Tags |
add-in, shared variables, word2010 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
alidaanish | Word | 1 | 01-10-2014 10:44 PM |
![]() |
andrei | Excel | 2 | 01-19-2012 08:45 AM |
![]() |
mattbennion | Word VBA | 1 | 12-21-2011 07:23 PM |
![]() |
webharvest | Word VBA | 5 | 06-21-2011 03:22 PM |
Envelopes with Document Variables | mailtobln | Word | 0 | 02-11-2009 10:48 PM |