Outlook 2010 ribbon customization

N

Noam Gal

I am trying to add a ToggleButton to the main explorer ribbon. When I put it
in the "TabAddIns" it works as expected, but I want to add it to the home Tab
instead.

I realize I have different "home" tabs for the different explorer views, but
at first I just tried putting it in the "TabMail", and I can't seem to get it
to work in there at all when I set either the getImage or the getVisible
delegates.
In other words, this works:

==================
<tab idMso="TabMail" >
<group id="explorer_MyGroup" label="MyGroup" getVisible="GroupVisible">
<toggleButton id="MyToggleButton" size="large"
onAction="ToggleButton_Action" imageMso="HappyFace" getLabel="Button_Label"
getPressed="Button_Pressed" visible="true" />
</group>
</tab>
==================

but this doesn't:
==================
<tab idMso="TabMail" >
<group id="explorer_MyGroup" label="MyGroup" getVisible="GroupVisible">
<toggleButton id="MyToggleButton" size="large"
onAction="ToggleButton_Action" imageMso="HappyFace" getLabel="Button_Label"
getPressed="Button_Pressed" getVisible="Button_Visible" />
</group>
</tab>
==================

and neither does this:
==================
<tab idMso="TabMail" >
<group id="explorer_MyGroup" label="MyGroup" getVisible="GroupVisible">
<toggleButton id="MyToggleButton" size="large"
onAction="ToggleButton_Action" getImage="Button_Image"
getLabel="Button_Label" getPressed="Button_Pressed" visible="true" />
</group>
</tab>
==================

It all works fine under the "TabAddin", as I mentioned - there are no
(related) bugs inside the image/visible delegates.
Is there something special in the "TabMail" causing this problem?
 
N

Noam Gal

My bad -
The error was (naturally) in my code. I called the GetVisible before I
finished setting up all the variables, and after adding an "Invalidate" call
at the end I got it working just fine.

One thing I did notice is that when switching tabs (in the same explorer
window), it does not re-evaluate the GetPressed, so I can close my
CustomTaskPane while on another tab, return to the TabMail (for example), and
still see my custom button as pressed. In an Inspector window this does not
happen - is it a bug, or am I missing out on something again?
It also caches the Label/Screentip/Supertip values, so I can't dynamically
change them according to the current state. Is this the expected behavior?
 
K

Ken Slovak - [MVP - Outlook]

If you call Invalidate() or InvalidateControl() you should get callbacks for
the label/etc. values. Do you see that?

I'd have to check on the behavior of a toggle in an Inspector versus an
Explorer, offhand I don't recall how they react to tab switches.
 
K

Ken Slovak - [MVP - Outlook]

I haven't had a chance to start up any of the VM's where I have Outlook 2010
installed yet, but I can't reproduce what you describe when the tabs are
switched in the ribbon in an open mail item in Outlook 2007.

If I open an item that has a toggleButton on a custom tab I create then when
I select that tab I get the getPressed callback. I get that only the first
time the tab is selected, never again after that. If I call Invalidate() or
InvalidateControl() I do get the callback again. However, I don't get any
callbacks when the ribbon tabs are switched.
 
N

Noam Gal

Thanks for the swift reply.
You are right, the behavior is the same in explorers and inspectors. I
already had an Invalidate call in my inspector wrapper which I didn't see
yesterday, and that caused the difference.
I have now just put it in my base wrapper, and they both behave the same
way. I will also use Invalidate to cause the labels/screentips to be dynamic.

Thanks again for your help.
 

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