views:

33

answers:

1

I have one 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.

my requirement is like that-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.

A: 

Addin are application wide & it can't be loaded/unloaded per document. In order to catch the document open/close, you could hook into the appropriate event from the Application class

EDIT: I haven't used c#. But, here is what I suggest (based on my VBA understanding).
You will have to declare & hold an instance variable of the Application class. Subscribe to the events such as DocumentBeforeClose and DocumentOpen & have appropriate structure to hold the fullpath of the document & time of open/close as per the events.

Does it give you enough info on what you are trying to do?

shahkalpesh
plzz kalpesh u suggest how can i do that????????? you have some idea...?
Ashwin Upadhyay