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

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)

Related

Create a custom button with icon in a custom group for Outlook using C# VSTO

I am fairly new to C# as well as the Outlook Library.
I have created a custom group in Meeting Tab of Outlook, which has a button in it.
I also added an image in properties of Button(as displayed in the screenshot).
The image would represent the logo of my add-in. But I'm not able to change the size of that image.
I want my button to look similar to that of other buttons of Outlook just like 'Skype Meeting' or 'Meeting Notes' with the larger icon.
Can anyone please suggest me the way to design the Button with large icon.
I have created the Ribbon (Visual Designer) in Visual Studio 2015 for Outlook 2016 Add-In using VSTO. What would be the best way to do this using C#?
There are two sizes for "button" ribbon control:
size="large"
size="normal"
If you add into your button control XML large size, you'll get the button look you are referring to. For more information on how to customize Office Fluent Ribbon please refer to the following great resources:
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)
I got the solution for this problem.
We can set the property 'ControlSize' of Button to 'RibbonControlSizeLarge'.

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)

Webbrowser on Excel Ribbon?

I'm using Visual Studio 2008. It is possible to add a Webbrowser item to a Form item, but is it possible to add a Webbrowser item to a Ribbon item ?
Or is there another way of showing a Web Page on the Ribbon ?
There is something called Ribbon-XML, may that do the job ?
Or is it possible to bind a Form (inheriting a Webbrowser) to the Ribbon ?
No, there is no way to place any third party controls on the ribbon except the ones defined by the Ribbon scheme.
Instead, you may consider placing a web browser control on a custom task pane. See Custom Task Panes for more information in MSDN.
Read more about the Fluent UI (aka Ribbon UI) in the following series of articles in MSND:
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)

How to add a group to a (VBA) custom ribbon without xmlns/idQ?

Situation:
Users have an existing custom ribbon that is added via a .PPAM (combination of VBA macros and Ribbon customization XML).
We want to add a group to that custom ribbon via our managed COM add-in
For custom ribbons from other managed COM add-ins this is feasible via the xmlns:foo="bar" & idQ that can be extracted from the customUI Link
Complication:
Custom Ribbons from non-managed add-ins seem to have no xmlns namespace, they do not show up in the customUI
Even via PowerPoint/Office the user can not customize those ribbons.
Any idea how we could achieve adding buttons?
We can request changes to the non-managed/VBA add-in.
VBA add-ins don't have their own namespace by default, but can have one. If you create a custom namespace, then multiple VBA add-ins can share the same tab on the ribbon, for example.
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"
xmlns:nsMySpace="SomeName">
Then to create a new tab that other add-ins can share:
<tab idQ="nsMySpace:MySpace_Tab" label="MyTabLabel">
In addition to Steve's answer we've discovered that VBA add-ins have a default namespace even when none is specified in their customUI.
You can extract the namespace by adding a control from the ribbon to the Quick Access and then exporting the UI Customizations. The resulting file should show:
<mso:cmd app="PowerPoint" dt="1" />
<mso:customUI xmlns:x1="C:\Users\USERNAME\AppData\Roaming\Microsoft\AddIns\Addin.ppam">
So the default namespace seems to be the complete Path to the add-in.
From a high perspective two add-ins can share a ribbon tab for controls because they are loaded into a single PowerPoint instance. When you develop a macro enabled file with a custom UI - only this file can be opened at the same time. But two add-ins can be run for the file/template. That's why idQ is intended to use by add-ins.
You can read more about the Fluent UI (Ribbon 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)

Outlook create a button like 'Private'

I want to create a button like the 'Private' button when creating a new appointment/meeting. So that the button freeze in the mouse hover style when it gets clicked.
I create the button in the VBA project like this:
Set objCBC = objCB.Controls.Add(Type:= --WHICHTYPE--, _
Temporary:=True)
So does anybody know which type of button should be applied here??
Command bars were deprecated. You need to use the Fluent UI (aka Ribbon UI) instead. Unfortunately Outlook doesn't allows to customize the Fluent UI with VBA, you need to develop an add-in instead. You can read more about the new 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)
See the toggleButton control in the list of available controls.