Phantom Keytip conflict in Microsoft Office 2010 Ribbon Custom UI - ms-office

I'm trying to create a custom ribbon in one of my Excel 2010 addins, and for some reason Office is overriding some of the keytips (keyboard accelerators). I know if Office sees a conflict it will usually override one or both of the keytips to "Y", "Y2", "Y3", etc.. but in this example I only have one button in my tab so there is no other control for it to conflict with.
Here is the XML:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab id="tabid_1" label="SampleTab" keytip = "B">
<group id="grpid_1" label="SampleGroup">
<button id="btnid_1" label="SampleButton" keytip="Z" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Instead of the SampleButton having a keytip of Z, it gets replaced with "Y2".
I see this behavior regardless of the keytip of the Tab (which is currently "B").
I checked to make sure that there wasn't some other button with a keytip of "BZ" that might be conflicting, but didn't see any.
I also see that behavior if I try to make the keytip of the SampleButton be "Y", but I assume this is because all "Y*" keytips are reserved for conflicts.
Incidentally, I was also having this problem with a keytip of "C", but for some un-explained reason that was happening only when I didn't have a label for the <group>. As soon as I added a label to the <group>, "C" stopped being overridden with "Y2". Very strange behavior.
Anyone have any ideas what could be causing this?
Thanks in advance!

I was having the same issue and I ended up just changing the keytip value from an uppercase "Z" to a lowercase "z" and it worked. No idea why. Hopefully it works for you.

This is the standard behaviour for custom (as opposed to builtin) tabs in an office application.
To test this yourself simply add a couple of custom tabs through the UI.
next hit the ALT key and notice how all of the custom tabs are Y1, Y2, Y3, accelerators..
However as noted by the OP, this shouldn't be the behaviour when setting the keytip property programmatically or through XML for the addin's ribbon UI elements.
Since it only happens with a limited subset of key combos I'd imagine it could be a bug. Recommend logging this on the microsoft connect website.

Sorry but the accepted answer didn't work for me!
In my VSTO solution I empirically found a working ALT-Shortcut is "G".
So in my C# code I set:
Globals.Ribbons.GetRibbon<MyRibbon>().tabMyRibbonTab.KeyTip = "GGG";
I use three G's to minimize conflicts with other Add-Ins.
This worked for me and I could even select the RibbonTab in Excel 2007 by using SendKeys (see this other question).
Regards, Jörg

Related

Add Solver to Custom Ribbon to Show the Solver Parameters Dialog Box

The goal is to add the standard Solver button to a custom ribbon.
Background: I have code that creates a Solver model automatically using custom ribbon buttons. However, before actually running Solver, I would like the user to verify, and modify as necessary, the automatically-generated Solver model - by showing the Solver Parameters dialog box. For the user's convenience, I want to put the standard Solver button on my custom ribbon.
Problems were:
Solver does not have an official Microsoft msoImage or onAction item. So, I created my own button that called SolverOkDialog(). BUT,...
SolverOkDialog does not display the Solver Parameters dialog box (at least I couldn't get it to do so).
Solution:
Big picture: Grab the icon and link from Solver.xlam.
Copy C:\Program Files (x86)\Microsoft Office\Office15\Library\SOLVER\SOLVER.XLAM to a new file, Solver.zip.
Copy ….zip\customui\images\solver_icon.png to someplace convenient.
Using your favorite ribbon xml editor(1) assign solver_icon to RibbonX14.
Insert the following code to your custom ribbon:
<button id="btnSolver"
getLabel="solver.xlam!GetSolverLabel"
image="solver_icon"
onAction="solver.xlam!MainEx"
screentip="Solver"
supertip="What-if analysis tool that finds the optimal value of a target cell by changing values in cells used to calculate the target cell."/>
I hope this helps someone.
If I am missing something, please let me know.
​(1) I use Leaf Creations Office ​Ribbon Editor because it is simple, functions well, and it is Creative Commons compliant.

Dynamics Sub Grid (+) behavior in Multi-Solution Environment

I have Quote Line Entity in Solution-1. I have customized "Add New Record" (+) button in Solution-1. Similarly I have customized "Add New Record" (+) ribbon button in Solution-2. Both of them are managed solutions.
If I Import both the solutions one on top of the other, Will one over write the ribbon customizations of previously installed solution ?
Yes, it would, remember customizations essentially all boil down to XML. CRM stores customizations as XML, so importing solution on top of another which target similar attributes, elements end up overwriting the XML (customization).

Ribbon button value rule depending on statecode value

I added a new custom button to quote form ribbon. This button should only appear, if the statecode is active (Value: 1).
I created following CommandDefinition:
<CommandDefinition Id="mySolution.quote.Form.MyButton.Command">
<EnableRules />
<DisplayRules>
<DisplayRule Id="mySolution.QuoteIsActive" />
</DisplayRules>
<Actions>
<JavaScriptFunction FunctionName="myFunction" Library="$webresource:new_myLibrary" />
</Actions>
</CommandDefinition>
And following DisplayRule:
<DisplayRule Id="mySolution.QuoteIsActive">
<ValueRule Field="statecode" Value="1" Default="true" />
</DisplayRule>
But if I use this DisplayRule my button never appears. If I remove the rule from CommandDefinition the button is always visible.
I also tried to use 'Active' as value (as shown at the bottom of this post, with the same result.
What is the trick to define a rule depending on statecode? Or did I miss something?
Try using Status text values ("Open", "Draft", "Active", ect.) instead of number values. I have a similar case with Status Reasons. Hope it will help!
I couldn't find anything to verify this, but display rules seem to have issues in the command bar. I had better luck using enable rules, and those actually act like you would expect display rules to act in the command bar. In other words, if a button in the command bar is disabled then it's not displayed. You can read about it in the MSDN documentation.
I think your problem here is that your EnableRules is empty.
However, are you doing that modifications by hand?
If so, use CRM 2011 Visual Ribbon Editor, this tool will do almost all job for you.
I think that your problem is that Statecode should be 0, not 1. Do a sql query on statecode and statecodename (use FilteredView).
Just add simple .js script for updating ribbon. Ribbon updates only on page load. Thats why your button became always unvisible. Here is code sample:
function refreshRibbonOnChange()
{
Xrm.Page.ui.refreshRibbon();
}
Then add web resource and attach it to button click. Simple!

How to change Liferay Flag drop down values?

In liferay message board thread if we click on "Flag" then a window pop-up is coming with drop down values like "Violent & repulsive", "Spam" etc.
I want to change these text with my own words. I found code inside tomcat-6.0.18\webapps\ROOT\html\portlet\flags\edit_entry.jsp:
<option value="<%= reason %>"><liferay-ui:message key="<%= reason %>" /></option>
which is displaying the drop down but how can I edit the drop-down menu with my own words?
If anyone can suggest me how to proceed for here will be great help for me.
Thanks.
One way (easiest) is to override the following property in portal-ext.properties:
flags.reasons=sexual-content,violent-or-repulsive-content,My own flag,My content,Your violent acts
Hope this helps.
Extend this (to make it multilingual) by providing a new localization key instead of just a text. You can use a hook to introduce a new localization key into the portal, then just use the key here. If the key cannot be found (like in this sample e.g. "My own flag") it will be shown nontranslated.

How to add a custom item to the Microsoft Office Send To Menu

Is it possible to extend the "Send to" menu in Office (not the Windows one; I know how to do that). I would like to launch my own application with the source document as the target.
Update: I am looking for a non-VSTO based solution.
In 2007, you can extend the ribbon, and should be able to place your control in the group FileSendMenu in the tab Office Menu. I don't think this is supported in the designer available in the last VSTO-addin for Visual Studio, so you may have to hand craft your xml.
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="OnLoad" loadImage="OnGetImage">
<ribbon>
<officeMenu>
<menu idMso="FileSendMenu">
<button id="oButtonId"
insertAfterMso="FileInternetFax"
getDescription="GetDescription"
getLabel="GetLabel"
getScreentip="GetSuperTip"
getSupertip="GetSuperTip"
getVisible="GetVisible"
onAction="OnButtonPress"/>
</menu>
</officeMenu>
</ribbon>
</customUI>
You will need an event handler ("OnButtonPress") as well has handlers for description, iconst etc. You could do this with VBA, but I would rather go with a proper Add-In.

Resources