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.
Related
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.
I want to add multiline item to ribbon menu (Microsoft.Office.Tools.Ribbon.RibbonMenu) in my office add-in like following image. but I don't know what these items should be?
*RibbonButton doesn't support multiline Label.
*RibbonLabel doesn't support variable font styles (like Bold and Normal).
UPDATE: if these features are not supported, is there another component (say DevComponents, Telerik, ...) that supports them?
Unfortunately not all ribbon features are available for developers. There is no way for add-in developers to implement something like that unfortunately.
You can read more about available ribbon controls and their attributes 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)
I'm totally newbie in Office Add in Development.
Started few hours ago :)
Office version: 2016
I would like to create an add-in, with a button that will allow me to synchronize my email with my custom program and "flag" it to avoid a new synchronization in the future.
For that, it would be necessary to:
add a button (it seems simple to me, but by following this link, I did not manage to see the button when debugging in Outlook)
I would like the button is present in the ribbon that appears when you open an email, and only down (it would prevent a synchronization of several emails at once) - and I can not find the name of the adequate control. There is a list of Excel files (here) but which corresponds to the one of the opening of the mail message?
perform any action when the user clicks the button - I guess that's a simple event of the button, but how can I get the opened message data and metadata (sender, to, cc, subject ...)
"flag" the email, so as to avoid a second synchronization. The ideal is to add an icon to the email in the list of emails, as is done for an email containing attachments etc ...
I know I'm asking a lot, but I'm not asking to get the job done, just to be able to steer in the right direction. So if you have tutorials, articles etc ... to help me, it would be great.
Thank you
N.B.: Copy of this question has been posted in VSTO forum here
To create a custom ribbon UI, VSTO provides two possible ways:
Walkthrough: Create a custom tab by using the Ribbon Designer
Walkthrough: Create a custom tab by using Ribbon XML
To keep a separate state for the control for each inspector window separately you need to implement ribbon callbacks and call the Invalidate or InvalidateControl methods of the IRibbonUI interface. Read more about these methods in the following articles:
OfficeTalk: Display and Hide Tabs, Groups, and Controls on the Microsoft Office Ribbon User Interface (Part 1 of 2)
OfficeTalk: Display and Hide Tabs, Groups, and Controls on the Microsoft Office Ribbon User Interface (Part 2 of 2)
The Fluent UI (aka Ribbon UI) is described in depth:
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)
Is there a way to use Netoffice to customize Office/Excel Ribbon at runtime, My concern is that I am trying to make plugin-able addin that adds button to Ribbon based on available action of my plugins.
I actually created my tab using XML but I can't figure out how to add items dynamically at runtime.
Thank you for help.
As far as I know netoffice doesn't provide anything for customizing the Fluent UI. The Ribbon UI is a static thing from its birth. The only possible dynamism is callbacks. For example, you can define a dynamicMenu which provides the getContent callback (gets an XML string that contains the contents of this dynamic menu).
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)
Also you may find these articles helpful:
Chapter 11: Creating Dynamic Ribbon Customizations (1 of 2)
Chapter 11: Creating Dynamic Ribbon Customizations (2 of 2)
I am creating Outlook ribbon which has couple of dynamic menus in it, I am invalidating ribbon on click of dynamic menu buttons. Problem I am facing is when I say ribbon.invalidate() contents of dynamic menu are not cleared and holds contents which were added previously.
How can I clear the dynamic menu and force to rebuild it ?
What is your ribbon XML markup?
In essence you needed to implement the getContent callback in the code for the dynamic menu control where you return an appropriate dynamic ribbon XML markup.
You can read more about the Fluent UI in the following 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)
Also you can read about dynamic customizations in the Fluent UI and find the sample code:
Adding Custom Dynamic Menus to the Office Fluent User Interface
Chapter 11: Creating Dynamic Ribbon Customizations (1 of 2)
Chapter 11: Creating Dynamic Ribbon Customizations (2 of 2)