Shared Addin for Word 2003  
Author Message
HumteeDumbtee





PostPosted: Visual C# General, Shared Addin for Word 2003 Top

Hi,

I've created a shared addin for MS Word 2003 in C#. The addin comprises of a toolbar which loads and works fine for the very first instance of Word. For subsequent instances of Word, the toolbar is visible but doesn't work. What am I doing wrong here


Visual C#8  
 
 
SvenC





PostPosted: Visual C# General, Shared Addin for Word 2003 Top

Make sure that you store all dynamically added toolbar items like buttons in instance fields of your class so that they are kept referenced and the GC won't collect them as it might when they are local variable only.

--
SvenC


 
 
Cindy Meister





PostPosted: Visual C# General, Shared Addin for Word 2003 Top

This isn't the right place to ask about shared add-ins. There's a newsgroup for that

http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.office.developer.com.add_ins&lang=en&cr=US

and if you search it (GoogleGroups, for example) you should find a number of discussions about issue. Two things you need to watch out for: 1. Declare the object variables for the commandbar and all buttons as member fields (not locally) so they don't get GC'd. 2. Assign a (unique) value to the TAG property of all the buttons so that they're recognized when multiple windows. See also

http://support.microsoft.com/kb/302901/en-us