VSTO Outlook: Create a custom quick access toolbar (QAT) programmatically - outlook

I have seen that Outlook has a quick access toolbar (QAT).
You can access it doing below:
And then the QAT appears (see below screenshot, I marked it with a blue rectangle):
So taken into account that a custom task pane (ctp) have some limitations, for example, you cannot remove title bar nor buttons I was thinking about if it is possible to create a QAT programmatically and embed into it an WPF user control.
Is it possible?

No, it is not possible. At least there is no trivial way of getting the job done without Windows API functions involved.
The QAT (Quick Access Toolbar) has a predefined set of controls that can be put inside it. 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

VSTO CommandBarButton click modifier

I create a toolbar menu hierarchy in Outlook using VSTO, CommandBarPopup and CommandBarButton. I set a Click handler on the CommandBarButton's and everything works fine, but I would like to be able to do different things in the click handler depending on whether the user right-clicked on the menu, or shift-left-clicked or what not (for example, to include or not include the original message when automatically composing a template reply).
How do I detect which mouse button the user clicked with, or whether shift, alt, or ctrl keys were pressed when the user clicked?
In the event handler you can use the Keyboard.GetKeyStates method which gets the set of key states for the specified key.
// Uses the Keyboard.GetKeyStates to determine if a key is down.
// A bitwise AND operation is used in the comparison.
if ((Keyboard.GetKeyStates(Key.LeftShift) & KeyStates.Down) > 0)
{
// the left shift is pressed now
}
CommandBars were deprecated with Office 2010. You need to use the Fluent UI for creating a custom UI in the add-in. There are two main ways in VSTO to create a custom UI:
Walkthrough: Create a custom tab by using the Ribbon Designer
Walkthrough: Create a custom tab by using Ribbon XML
A context menu is customized using the Fluent UI as well. See Extending the User Interface in Outlook 2010 for more information.
The Fluent 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)

How to customize top nav of model driven app of Dynamics 365

How can I customize the top nav of model driven app.
I need to customize the top nav and add a link or button.
That's the command bar (previously known as the ribbon bar).
There is a decent bit of documentation at Customize commands and the ribbon.
You effectively need to download the Dynamics solution and edit the XML of the solution.
Both the command bar and the ribbon use the same underlying XML data
to define what commands to display, when the commands are enabled, and
what the commands do.
However, there are community tools that make this process significantly easier - Ribbon Workbench.

MS Outlook 2016 Ribbon Scaling issues

When the width of an Outlook Explorer or Inspector window is reduced the ribbon changes. In my VSTO addin can I influence how the scaling happens with the Office Ribbon?
Further at a certain width the tab becomes a single icon with a small arrow which when clicked the buttons/elements of the tab appear in a pop-up. How can I set the icon that appears in this case?
Below is my current XML for the tab.
I have also added a picture of how my ribbon looks when the window is made narrow.
I am not able to find a new XML Markup from Microsoft is this really the latest version [MS-CUSTOMUI2]: Custom UI XML Markup Version 2 Specification
<tabs>
<!-- Creates a new App Tab on the inspector toolbar-->
<tab idMso="TabReadMessage">
<group id="AppGroup" label="App">
<!-- A toggle or ON/OFF button to Encrypt or Decrypt an email and show the current encryption -->
<toggleButton id="insDecryptButton"
getLabel="insDecryptButton_getLabel"
size="large"
onAction="insDecryptButton_ButtonClick"
getImage="insDecryptButton_getImage"
getSupertip="insDecryptButton_getSupertip"
getScreentip="insDecryptButton_getScreentip"
getPressed="insDecryptButton_getPressed"
getVisible="insDecryptButton_getVisible"/>
<!-- A Button with drop down that shows all the File Numbers in the Email. If there are no file numbers this will not appear. -->
<dynamicMenu id="insMenu"
getLabel="insMenu_getLabel"
size="large"
getImage="insMenu_getImage"
getVisible="insMenu_getVisible"
getSupertip="insMenu_getSupertip"
getScreentip="insMenu_getScreentip"
getContent="insMenu_getContent"/>
<!-- Button to upload the email or attachments to IPAS -->
<dynamicMenu id="upMenu"
getLabel="upMenu_getLabel"
size="large"
getImage="upMenu_getImage"
getVisible="upMenu_getVisible"
getSupertip="upMenu_getSupertip"
getScreentip="upMenu_getScreentip"
getContent="upMenu_getContent"/>
</group>
</tab>
Office applications perform the scaling optimization on its own. There is no new schema for that. Instead, as other poster noticed, you need to provide the getImage callback to all your group controls. It should look like this:
C#: IPictureDisp GetImage(IRibbonControl control)
VBA: Sub GetImage(control As IRibbonControl, ByRef image)
C++: HRESULT GetImage([in] IRibbonControl *pControl, [out, retval] IPictureDisp ** ppdispImage)
Visual Basic: Function GetImage(control as IRibbonControl) as IPictureDisp
Calling the Invadiate or InvalidateControl you may get a new image displayed (so, your callback will be invoked).
Read more about the Fluent UI (aka Ribbon UI) in the following 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 want to know more about dynamic customizations you may take a look at:
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)

Office Add-in Ribbon Button Sizes and Properties Documentation

I'm creating a custom ribbon for an outlook addin, but the button sizes, large, medium, and small are not defined anywhere. What are the size I should use for large/medium/small images in Microsoft.Office.Tools.Ribbon.RibbonButton.Button ?
Will it autoresize or is there a certain size I need to use?
EDIT: Seems in properties for the button you can change ControlSize to large. But my second edit is the question I now need answered.
EDIT2: Is there documentation for the properities for ribbons in Visual Studio 2013? As in what all the different properties do?
16x16 - small
32x32 - medium
48x48 - large
The Fluent UI (aka Ribbon UI) is based on the XML markup and IRibbonExtensibility interface which add-ins should implement to get the custom UI displayed in Office applications. I'd suggest reading the following series of articles that describe the UI 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)
Controlsize paramter in properties can be set to large. I know it can be done in XAML but not sure how or in Outlook.Ribbon.Designer.cs... Form my purposes it seems to work fine.

MS Access 2007 Load Image to Ribbon

I'm trying to get to grips with customising a Ribbon Bar for a converted A2003 app. I'm trying to work out how to use my own custom images on button controls in the ribbon. Can anyone point me to an example for Access 2007 that can do this pls?
Please check this MSDN article (Adding Custom Dynamic Menus to the Office Fluent User Interface) and see if it helps you. Furthermore I would point you to the specifying image resource MSDN article, because you need different sized images for different sized buttons - read the bottom of my post to make it easier on you.
I believe there was also custom images within the official MS example on ribbon extensibility with Access 2007 - I hope this example is sufficient, it helped me a great lot.
My personal favorite is just using a graphical UI editor, such as the "Custom UI Editor Tool". With it you just click a button to insert an image and it works (as explained in this tutorial). Even better as the Custom UI Editor is the IDBE Ribbon Creatror - my personal tool of choice. A shareware version is available from the website.
I have a working example class object you can use that makes this a good deal less code.
http://www.members.shaw.ca/albertKallal/Ribbon/ribbon.htm
The above lets you use a very much like previous style code approach. So, to set a picture for a ribbon, you can go:
meRib("Button1").Picture = "HappyFace.png"
The same download has a working form in which some images in the ribbon change from choices made on the form.

Resources