ActiveInspector usually works, but not always.
The best practice is to construct a unique Tag property for each button you
create. I usually use a GUID or unique string value with a Key value
assigned to each open Inspector. The key value gets incremented each time an
Inspector is opened. That key is stored in a public property in the
Inspector wrapper class so it's accessible. I make up the tag value with the
GUID and key, then when a Click occurs it will only occur in that wrapper
class in the Click event handler inside that class.
If you don't use a unique Tag then Click will fire in every single open
Inspector, so if you're handling Click in one place and there are 3 open
Inspectors then you'll get 3 click events firing. Using Inspector wrappers
is another best practice, as is using Explorer wrappers to handle open
Explorers.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"saturn" wrote in message
oups.com...
Now I am able to trap the click of my button. But the callback
function receives CommandBarButton. Using this how I can identify the
inspector on which the button was clicked? How suitable is to conside
the active window?
Regards,
Pradeep