Adding controls to Outlook 2013 "inline response" contextual ribbon - outlook-addin

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>

Related

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

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.

Display a custom tab on Word Ribbon depending on the version of Word detected?

I have customized the Office Ribbon adding a new tab to the Word ribbon by creating a custom XML file. The customization is in a template in the Word start-up directory. I am using Word 2016. It works under Word 2016; however it does not work in Word 2010. When opening a document in Word 2010 I get the dreaded "Error in hidden module" message. After hours of debugging and researching I cannot find the cause of this error in my VBA code.
All the users in my company should be using Word 2016, however I must assume that some users will still be using Word 2010.
If a user opens a document using Word 2010 I don't want my custom tab to be visible, that is I don't want the OnLoad event to fire.
I tried the following code in the OnLoad Event callback:
If Application.Version = "16" Then
Set myribbon = ribbon
Else
End
End If
In the other callbacks such as ToggleOn Action, getlabel, getTag, GetImage I checked for the Word Version like this:
Public Sub…
If Application.Version = "16" then
Do callback code
Else
End
End If
End Sub
However, the ribbon always loads and I could not find a way to stop it from loading. I also believe that you cannot hide a custom tab on the ribbon using VBA.
To solve this problem I did the following:
I put a template in the startup directory that checked for the correct version of Word. If the correct version was found, it loaded a template as an add-in from the users template directory with the ribbon customisation and my VBA code.
It works, but it means I have to distribute two templates to the users. Ideally I'd like to have to distribute only one template.
Is there a way to enable or prevent the OnLoad event firing, that is display a custom tab, depending on the version of Word detected?
Use getVisible callback.
XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="tab1" label="CUSTOM" getVisible="OnGetTabVisible">
<group id="group1" label="Group1">
<button idMso="SaveAll" label="Save All" size="large"/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Callback:
Sub OnGetTabVisible(ctrl As IRibbonControl, returnVal)
If Val(Application.Version) = 14 Then
returnVal = False
Else
returnVal = True
End If
End Sub
UPDATE
I would suggest following resources:
RibbonX: Customizing the Office 2007 Ribbon
Excel 2007 VBA Programmer's Reference
Ron de Bruin Excel Automation

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.

VB 2010 Open Word document and Hide Office Ribbon

I am able to open a Word document from within my VB 2010 application. I need to hide the MS Office ribbon and set the Show Ruler option to false upon opening the document. Is there a way to do it?
Try adding ribbon <startFromScratch = "true"> at the begining of the ribbon xml code. The code might look something like this:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="true">
'your code here
</ribbon>
</customUI>

How to add tabs to PowerPoint 2010 that call macros

I have created a pptm file with macros that open certain pptx templates. I then created a new tab with buttons for opening the files. I attached the macros I created to those buttons. All works great as long at my pptm file is open. But after I save it as a ppam file and install it as an add-in it no longer works. It seems the macros don't come along and the buttons are still trying to reference the macros via the pptx name.
Does anyone know a simple way to create a custom tab to launch predefined templates? Or load macros by default like Word does? Or fix my situation above? The only alternative I see is an add-in that will only show up under the Add-In's tab.
Are you manually creating the ribbon with the buttons? I use the Custom UI Editor Tool and it works like a charm.
Just create any macro in your .pptm, like this:
Sub SayHello(ByVal control As IRibbonControl)
MsgBox "hello"
End Sub
The (ByVal control As IRibbonControl) part is important.
Then save and close your .pptm.
Open the Custom UI Editor Tool. From that tool, click Open from the File menu and navigate to your .pptm and open it.
On the Insert menu, click Office 2010 Custom UI Part. This will create a new XML document that will be inserted into your .pptm.
You can then use sample snippets to start creating your ribbon, but the simplest is just from the Insert | Sample XML menu, just click on Custom Tab. This will insert:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="false">
<tabs>
<tab id="customTab" label="Custom Tab">
<group id="customGroup" label="Custom Group">
<button id="customButton" label="Custom Button" imageMso="HappyFace" size="large" onAction="Callback" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Where you see Callback in after onAction, replace it with the name of your macro. In our example above, it is SayHello, so it should now look like onAction="SayHello".
Click Save and then close the Custom UI Editor Tool.
Open your .pptm in PowerPoint and test that a tab called Custom Tab has been created. Navigate to it and click on the happy face button. You should now get a message box.
Go to the Backstage by clicking on File and click Save As... and then choose as the file type PowerPoint Add-in (*.ppam) and save it in any location. Note the location.
Go to File | Options | Add-in and then select PowerPoint Add-ins from the Manage dropdown at the bottom of the dialog. Then click Go. Click **Add New...* and add your add-in from the location you saved it.
Close PowerPoint and reopen it. The Custom Tab ribbon should be there. Click on the happy face icon to run your SayHello macro.
The only thing you'll need to do beyond this is to customize your macros and ribbon controls they way you need them and for what you want them to do. Check out this link for more info: Customizing the 2007 Office Fluent Ribbon for Developers