VSTO Custom XML ribbon tab contains a group not specified in the XML - vsto

I have a custom XML ribbon tab in a VSTO Excel Add-in. The XML for the custom ribbon tab is below.
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<ribbon>
<tabs>
<tab idMso="TabAddIns" label="EMP">
<group id="EMPForms" label="Measurement Study">
<button id="EMPStudy"
label="EMP Study"
screentip="EMP Data"
supertip="Measurement Study Data"
onAction="OnEMPData"/>
<button id="StudySetup"
label="Study Setup"
screentip="Setup"
supertip="Measurement Study Setup"
onAction="OnStudySetup"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
There is only one group specified in the XML.
When I run the Add-in, I get two groups. The first is "Custom Toolbars". The second is "Measurement Study". The "Custom Toolbars" is not specified in the XML below.
Is there a way to prevent groups or controls from other ribbon tabs from appearing on a custom ribbon tab?

Try to check out other add-ins and Excel documents (they may contain a custom ribbon UI).
There is no way to hide controls or groups on a custom ribbon tab if you don't know their IDs. The best what you can do is to use the startFromScratch attribute which allows hiding the built-in ribbon controls. Read more about the Fluent UI (aka Ribbon UI) in the following series of articles:
Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

The source of the "Custom Toolbar" group on my custom ribbon is the "Team Foundations Add-in".
Below are the steps that resolved this issue.
Start Excel.
Go to File | Options.
Click the "Add-ins" item in the list box on the left-hand side of the Excel Options dialog.
Select the "COM Add-ins" item of the Manage combo box.
Click the "Go..." button.
Clear the check box for the "Team Foundation Add-in" entry and click the "OK" button.
The "Custom Toolbars" group is no longer in the custom ribbon tab.

Related

Is it possible to add new items into built-in RibbonGallery control in Outlook

Is there any way to add new buttons into the existing Move to folder dropdown (Gallery control with idMso="MoveToFolderGallery") in Outlook VSTO addin?
I was able to find Group containing it, and hide it with
<group idMso="GroupMoveActions" visible="false">
</group>
and add the same Move gallery to my group with changed name
<gallery idMso="MoveToFolderGallery" size="large"
label="zzz">
<button id="b1" label="My button"/>
</gallery>
But the button I have added does not appear (when I do the same with my own gallery, it appear).
Maybe there is a way to get RibbonGallery instance for the existing gallery and modify Items collection?
https://learn.microsoft.com/en-us/dotnet/api/microsoft.office.tools.ribbon.ribbongallery.items?view=vsto-2017
You can't modify built-in controls. But you can add controls into your own custom UI (or just rebuild the whole ribbon from scratch) where you can add additional items.
Read more about the Fluent UI (aka Ribbon UI) in the following series of articles:
Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

Change the font size/font color/background color of a label on ribbon in vsto outlook add-in

I am writing a outlook addin using vsto and c#
I have a xml ribbon bar containing some information that I need to show to the user. For example the xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<ribbon>
<tabs>
<tab idMso="TabAddIns" label="NEW_TAB">
<group id="StatsGroup" label="Statistics">
<labelControl id="lblSmallText" label="Stats are: "/>
<labelControl id="lblNormalText" label="Dollars Saved"/>
<labelControl id="lblBigText" label="$12345"/>
<!--
<labelControl id="lblNormalText" label="as of today"/>
-->
</group>
</tab>
</tabs>
</ribbon>
</customUI>
I need to INCREASE the font size of one of the labelControl OR alternatively at least be able to change the font or background color to bring the user's attention to it.
I tried adding font attributes in the xml but it is having no effect.
The Fluent UI (aka Ribbon UI) doesn't provide anything for that. Read more about all available attributes and callbacks in the following series of articles:
Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)
If you need to show a custom UI to a user in Outlook consider using Outlook Form Regions instead, see Creating Outlook Form Regions for more information. In that case you will be able to use any .net controls.

Outlook API :DymanicMenu showing only Top 5 items

I'm working with Outlook API dynamic menu control for my add-in. In my application I'm allowing users to add the paths from network drive and then add it dynamic menu control.
Every thing works as expected but the dynamic control always displays only 5 items at any point of time.
If there are more than 5 items in the control ,it displays only top 5.
Is there any size that we can set to display all the items .
I'm using Outlook 2010.
Thanks in advance.
What code do you use for adding new items to the menu?
Typically you need to define the getContent callback in the Ribbon XML markup. For a dynamic menu, retrieves XML content that describes the menu. Gets an XML string that contains the contents of this dynamic menu. The getContent method must return XML similar to the following to populate the menu. For example:
<menu xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<button id="dynaButton" label="Button"
onAction="OnAction" imageMso="FoxPro"/>
<toggleButton id="dynaToggleButton" label="Toggle Button"
onAction="OnToggleAction" image="logo.bmp"/>
<menuSeparator id="div2"/>
<dynamicMenu id="subMenu" label="Sub Menu" getContent="GetSubContent" />
</menu>
Read more about the Fluent UI in the following series of articles:
Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)
Also you may find the following articles helpful:
Chapter 11: Creating Dynamic Ribbon Customizations (1 of 2)
Chapter 11: Creating Dynamic Ribbon Customizations (2 of 2)

In Outlook 2010 VSTO, how to hide builtin Groups?

I am trying to hide Built-In Groups (GroupContactsNew) in TabContacts. I have tried below CustomUI but "getTabContactGroupEnabled" never fires.
Does anyone knows how to do this? BTW: I was able to make entire "TabContacts" tab invisible by registering "getVisible" callback method at tab level.
<?xml version="1.0" encoding="utf-8" ?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<ribbon startFromScratch="false">
<tabs>
<tab idMso="TabContacts">
<group idMso="GroupContactsNew" getEnabled="getTabContactGroupEnabled">
</group>
</tab>
</tabs>
Regards,
Ramesh
Ramesh,
You need to rebuild the UI from scratch setting the startFromScratch attribute to true and defining tabs, groups and controls anew, declaring them with the idMso values. In that case you will be able to handle callbacks of the built-in controls.
Read more about the Ribbon UI (aka Fluent UI) in the following series of articles in MSDN:
Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

Adding controls to Outlook 2013 "inline response" contextual ribbon

I have an Outlook add-in that has been used for the last couple of years. When creating a new email, I had added a group of controls to the ribbon that would appear on the inspector window.
With the advent of Outlook 2013 and the in-line response feature, these controls do not appear on the ribbon. There is a new message contextual tab that shows when the in-line response is activated, and ideally this is where I would have the controls show.
The RibbonType used for the existing controls is Microsoft.Outlook.Mail.Compose, but I cannot see any option for the contextual in-line response.
The only solutions I have found on the Internet use Add-in Express but I'm just using VSTO.
Does anybody know how I can get my controls to show on the contextual ribbon?
It is possible with the Ribbon xml, not with the designer !
<customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<contextualTabs>
<tabSet idMso="TabComposeTools">
<tab idMso="TabMessage">
##Place your content here##
</tab>
</tabSet>
</contextualTabs>
</ribbon>
</customUI>