views:

52

answers:

1

I have one silly qus. i created one shared add-in in c#.net. This add-in is working fine. now i want this add-in is load again n again when any office application is opened. For e.g. when i open any MS word document then add-in is load for that and if after that i opened another MS word document without closing previously opened document then add-in is again load for newly opend MS word document. But when i opened MS word at first time the add-in is load and if i opened MS word again but add-in is already loaded.

A: 

See my answer here.

Andy Jacobs
No Andy,my requirement is not like that becaz my add-in is worked backgroundly that is its work only to record the opening,closing time of the word document and how much time spend onto that word document and also the name of this document. But when i opened one word document then add-in is loaded for that and if againg opened new word document then becaz of previously opened document add-in is not load for that document remember that priviously opened document is not closed. but if i closed previously opened document then for new document add-in is load.
Ashwin Upadhyay
Word is not acting like you expect - it is not starting a new instance when the user sees a new window. Take a look at the Events available to your add-in from Word, and subscribe to the relevant ones. For example, I believe you will find DocumentOpen, New and NewDocument useful. Instead of expecting your add-in to be loaded when the second document is opened, the first instance will get that event, and the first instance will have to manage both windows (and use other events to determine when the windows close, etc.).
Andy Jacobs