Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-13-2014, 10:41 AM
naq.abbas@gmail.com naq.abbas@gmail.com is offline Same values of variables in word add-in are being shared across multiple document Windows 8 Same values of variables in word add-in are being shared across multiple document Office 2010 64bit
Novice
Same values of variables in word add-in are being shared across multiple document
 
Join Date: Jan 2014
Posts: 1
naq.abbas@gmail.com is on a distinguished road
Default Same values of variables in word add-in are being shared across multiple document

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
Reply With Quote
Reply

Tags
add-in, shared variables, word2010



Similar Threads
Thread Thread Starter Forum Replies Last Post
Same values of variables in word add-in are being shared across multiple document Need help creating a Word document that is populated based on certain selected values alidaanish Word 1 01-10-2014 10:44 PM
Same values of variables in word add-in are being shared across multiple document add values from different variables with pivot table andrei Excel 2 01-19-2012 08:45 AM
Same values of variables in word add-in are being shared across multiple document Open new message in outlook using values from a word document mattbennion Word VBA 1 12-21-2011 07:23 PM
Same values of variables in word add-in are being shared across multiple document Update bookmarks and variables in document webharvest Word VBA 5 06-21-2011 03:22 PM
Envelopes with Document Variables mailtobln Word 0 02-11-2009 10:48 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:31 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft