Invalidate control in Ribbon

G

goran

I have a custom toobar that I create calling getcustomUI in connect module.
In the xml that I create on the fly i have a dropDown box. I load dropDown
dynamically so i provided getItemCount getItemId, getItemLabel callbacks.
Ocassionally I have to refresh dropDown based on the user selection in
dropDown and I do that by calling ribbon.invalidateControl. In the case that
I have multiple email Inspectors open I am able to get the correct inspector
and I have a global variable that reference ribbon object. My problem is when
I call ribbon.invalidatecontrol from my inspector wrapper class, it
invalidates all the dropdown in all open inspectors. Any ideas how to
invalidate control only in specific inspector?

Thanks,

Goran
 
K

Ken Slovak - [MVP - Outlook]

Since you have to supply the controlID for the ribbon control you want
invalidated are you supplying a unique controlID, where each dynamic control
for each open Inspector has a unique controlID?
 
G

goran

Hi Ken,

IRibbonExtensibility_GetCustomUI is called only once when the Inspector of
that type(i.e. Microsoft.Outlook.Mail.read) loads the first time, and this
is when UI gets created and controls assign their IDs. Right? How can create
new control and assign unique controlID to a control every time different
Inspector opens, when this prosedure run only once? How can I dynamically
create control when Inspector opens? I could do this with CommandBars, where
I put the code to create new control in New Inspector event that gets called
every time inspector opens, but not with ribbons.


Thanks for your help,

Goran
 
K

Ken Slovak - [MVP - Outlook]

That's correct. So any change made to the dynamic content would affect every
open Inspector and every one opened after that. That's a ribbon limitation
that wasn't very well thought out despite our bugs and complaints during the
beta.

Not much you can do about that really with a combobox control. I try to
avoid them for that and other reasons, as I mentioned earlier to you in this
or another thread. What I usually use instead, although it's not a complete
substitute, is the dynamic menu control. I can supply different content to
each Inspector based on invalidation of the control and supplying specific
content based on the ActiveInspector.
 
G

goran

Thank you Ken.

Ken Slovak - said:
That's correct. So any change made to the dynamic content would affect every
open Inspector and every one opened after that. That's a ribbon limitation
that wasn't very well thought out despite our bugs and complaints during the
beta.

Not much you can do about that really with a combobox control. I try to
avoid them for that and other reasons, as I mentioned earlier to you in this
or another thread. What I usually use instead, although it's not a complete
substitute, is the dynamic menu control. I can supply different content to
each Inspector based on invalidation of the control and supplying specific
content based on the ActiveInspector.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top