VSTO: Can I set idMso to button with ribbon designer? - c#

Can I set idMso attributes to button with the ribbon designer?
I'd like to show built-in buttons in my custom tab in PowerPoint VSTO add-in.

You need to deal with Ribbon XML if you need to set the idMso property. Note, you can design your custom UI using the ribbon designer and then export it to the ribbon XML file which can be edited later. See How to: Export a ribbon from the Ribbon Designer to Ribbon XML for more information.

Related

How to use the RibbonTab interface in c#?

I am working in excel VSTO add-in.
In excel, having built-in tabs, groups, and controls in the ribbon.
I am trying to use the Microsoft.Office.Tools.Ribbon RibbonTab interface.
But I am not able to use this interface.
private RibbonTab hometab;
public bool ShowVisibleView(Office.IRibbonControl control)
{
hometab.Name = "View";
var groupList = hometab.Groups;
return true;
}
Here, hometab comes as null. So, I can't able to set the value for Name property in RibbonTab.
How can I achieve this?
The ribbon tab should be instantiated first. There are two main ways for creating a custom ribbon UI in Visual Studio:
Walkthrough: Create a custom tab by using Ribbon XML
Walkthrough: Create a custom tab by using the Ribbon Designer
You can't also manage built-in controls on the ribbon. The best what you could do is to repurpose built-in controls or build the ribbon from scratch.
The Fluent UI (aka Ribbon UI) is described in depth 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)
Read more about repurposing built-in controls in the Temporarily Repurpose Commands on the Office Fluent Ribbon article.

How to disable/enable the built-in controls in excel VSTO c#?

I am working in excel VSTO add-in.
In excel, having built-in tabs, groups, and controls in the ribbon. I need to disable the built-in controls in the excel.
For example, under View tab and under window group have Split control. I need to disable that Split control.
In above image, View is a built-in tab and Split control is a built-in control. I need to disable this split control.
I tried by using the idmso property. I'm not sure what the value of idmso property for Split control is.
How to disable/enable the built-in controls in excel c#?
You are not allowed to disable/enable built-in ribbon controls. Instead, you may consider repurposing ribbon controls, see Temporarily Repurpose Commands on the Office Fluent Ribbon for more information.
Also you may re-build the ribbon UI from scratch. In that case you will be responsible to disable/enabled controls.

C# VSTO AddIn LookUp field Ribbon

I try to create a listbox with custom XML entries/values which appears after the user enters a text in a editBox.
The developer environment is C# Outlook 13/16 VSTO Plugin.
My problem is, I can only access with Ribbon Controls to an editBox or a comboBox.
With the comboBox I am able to add my custom XML entries like:
foreach (XmlNode node in source.DocumentElement.SelectNodes("/path/item/value"))
{
RibbonDropDownItem item = Globals.Factory.GetRibbonFactory().CreateRibbonDropDownItem();
string text = node.InnerText;
item.Label = text;
this.comboBoxCompose.Items.Add(item);
//System.Diagnostics.Debug.WriteLine(text);
}
The editBox e.g. does NOT provide to add items...
The comboBox is the wrong choice for me, because it is a dropdown selection.
Is there a way to implemnet a listBox with custom results like in the picture enclosed. Do I have to combine it with an other API/library?
Would be nice if someone could help here.
No, there is no way. The Fluent UI provides a definitive set of controls.
You can 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)
As a workaround you may consider creating a custom UI on the Outlook form region instead of Ribbon where you are free to use any .Net controls. See Creating Outlook Form Regions for more information.

How to Show Outlook Ribbon on multiple tabs c#

I am developing an Outlook plugin. I have added a ribbon with the ribbon type set to
this.RibbonType = "Microsoft.Outlook.Explorer";
and ControlId is set to TabMail. By default this ribbon shows on the Home tab in Outlook. But when I open an email in a separate window, when I switch to a different tab or when I view attachments, the ribbon does not appear. I also want to show this ribbon on the Message tab and the Attachments tab.
I have explored ways and got answers that refer to creating two ribbons, but that is not a proper solution.
I also followed this link, but with no luck.
The other solution i explored is to call event tabControl_SelectedIndexChanged on tabs to identify the current tab and then setting ribbon properties(ribbontype and ribbon control) run time.
How to do that for ribbon (Visual Designer)? Or I have to convert that into ribbon (xml)? And where to trigger that event?
Any help will be appreciated.
You should create a new Ribbon with ribbonType Microsoft.Outlook.Mail.Read and your controlId TabReadMessage
You need to choose appropriate values for the RibbonType property:
you can select such
List item
Microsoft.Outlook.Mail.Compose or
Microsoft.Outlook.Mail.Read

Adding to existing ribbon in Outlook c#

I would like to be able to add a button into the outlook ribbon, the idea is that when you access your calendar it would show in the "Home" ribbon. How would I go about doing this, ideas or links?
Thanks.
The main trick in adding to an existing ribbon is that you have to create your own (new) ribbon but set the ControlId property (ribbon designer properties) or the idMso (ribbon xml) to TabHome. The ribbongroups on your ribbon will then be added to the existing Home ribbon.
A complete list of all other ribbon names can be found here

Categories