Now that I think about it, I'm not sure how having a unique tag name will
help. I already do have a unique tag name created for each button. But
because of how the inspectors work, I have one button which may be attached
to several inspectors (because of the use of the previous and next buttons).
Thus when the one button is pressed, all inspectors' event sinks fire. And
because there is only one actual button, there is only one tag name to test
against, not one for each inspector. Perhaps I need to set up my buttons
differently? The way I am currently doing it is that when a new inspector
event occurs I search for the toolbar and button, and if they already exist,
I attach to the existing one. If it doesn't, then I create it. This worked
fine as long as I was using the item close event, but if I switch to the
inspector close event I get this problem.
Mark
"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:OQCjqX%(E-Mail Removed)...
> Any Inspector or Explorer button should have a unique Tag property. That
> prevents what you are describing.
>
> Next and Previous are problems. In fact in certain versions of Outlook you
> don't even get a Close event on the Item when they are used. I always
> backstop using both Inspector and Item Close since other things may also
> change the order in which they fire or prevent one or the other from
> firing. Such things as whether or not WordMail is being used and whether
> or not Send is pressed can affect that.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "Mark Smith" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> My addin places a tool bar with a button on each inspector window. As
>> per previous advice I am using the Item Close event rather than the
>> Inspector Close event to delete my toolbar wrapper (ToolBar).
>>
>> If the user uses the previous and next buttons, the Item close event
>> fires and the ToolBar attached to the inspector gets deleted. Then a New
>> Inspector event fires and a new ToolBar item is created and attached. On
>> the other hand, If the user deletes the item, the Item Close event fires,
>> but no New Inspector event fires. Thus the tool bar gets orphaned and no
>> longer functions.
>>
>> So I tried to use the Inspector Close event instead of the Item Close
>> event. This allows the button to continue functioning after the user
>> deletes an item. Unfortunately this leaves extra ToolBars around that
>> aren't needed. In and of itself, this is not a big deal. The problem is
>> that if the user has used the previous or next buttons or deleted items,
>> when the button is clicked, the button handler fires for each ToolBar,
>> resulting in the same operation occuring on that item many times.
>>
>> I have considered doing something with the tag name to make sure that a
>> pressing a given button only results in one action, but this seems like a
>> less than optimal solution. Other than that I can't think of anything.
>> If there is a better way, I would love to hear it. Any ideas?
>>
>> Thank you,
>> Mark Smith
>>
>