2010 ribbons and context menu with dynamic labels

P

Paul-Jan Pauptit

I have extended a default (Outlook 2010 folder-) contextmenu with some
<buttons> that need to have their label set depended on the currently
selected item (folder).

According to the MSDN articles, I need to hook all appropriate
selectionChange events, then call ribbonUI.invalidateControl(). However, I
have two problems with this approach:

1. Right clicking an item to popup a context menu does _not_ trigger a
selection change, does it? I needed to do some massive workarounds in Outlook
2003/2007 to figure out the folder that was "clicked on". I was really hoping
the new ribbon interface would solve this problem.

2. I cannot set a GetLabel event on a context menu button. Even though the
XSD says I can, Outlook simply refuses to read in the XML when I do.

Any help or guidance would be appreciated!
 
K

Ken Slovak - [MVP - Outlook]

Have you looked at Randy Byrne's article "O14_Extending the User Interface
in Microsoft Outlook 2010"?

For a folder context menu the IRibbonControl.Context property has the
Outlook Folder object. For an item menu that object would be a Selection
object. You get the Selection object and iterate it, if only one item is
selected the collection would have just one item.

Show the XML you are using for a label caption. You aren't using "GetLabel"
are you? It should be camel-cased as "getLabel".
 

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