Thanks again Ken! That got me there. One note though. In my case since I was
adding buttons to a sub-menu (CommandBarPopup), it took a couple coding
attempts on my part. Initially I had been deleting the added buttons from the
collection in the CommandBarPopup (the Junk E-mail sub-menu in my case), so I
simply did the Reset() call you recommended on that CommandBarPopup object.
That resulted in the same behaviour. My added buttons appeared on the first
context menu, but not subsequent ones. In order to finally fix the problem I
had to move the Reset() up a level to the CommandBar representing the
"Context Menu". Once I did that, my added buttons now appear ALL the time. I
appreciate the guidence.
John
"Ken Slovak - [MVP - Outlook]" wrote:
I use the Reset() method of the CommandBar to clear the user added controls
before I add them again in OnUpdate().
--
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
"John Erickson" wrote in message
news
That's what I'm attempting to do. I'm pretty sure my Unadvise is working
properly. Then I'm using the Delete method (in reverse item# order in case
Delete changes the item numbering as I'm traversing the controls
collection).
Is the Office::CommandBarControl:
elete method the proper way to remove
the
buttons I added on the first context display? I'm asking because it
doesn't
seem to actually remove the controls even though it succeeds. What's the
real
meaning of the bool argument in that method? There's a method called
__NewEnum (or something to that effect) should I be using that or some
other
call after the Deletes to rebuild the controls collection? It's just
really
odd that the same code works fine in Outlook 2002 but doesn't in Outlook
2000.
John