How can I create a new tab for only my custom add-ins? - ms-word

Designing an MS Word 2010 add-in using VS 2010. Each add-in has a group, button, and menu. Using the built-in AddIntabs to display the custom add-ins, all the custom group ribbons are displaying in the Add-ins tab properly.
I want to create a new add tab for only my custom add-ins. I tried renaming the built in add-in tab, but a 3rd-party add-in is also using this tab. When I change controlIdType from Office to a custom value and use the same ControlId for my add-in, this does not work. Instead it displays 2 tabs with the same name instead of merging them into one.
I am using Ribbon Designer; if the solution involves changing Ribbon XML, that is also acceptable.

Good question. The following provides the solution using the Ribbon XML.
If you create a new ribbon XML class from Visual Studio it will also add alot of the XML already for your solution.
The following will create a custom tab called "Drains". The id identifier creates a custom tab whereas the idMso uses the built in tabs.
<tab id=”t1” label=“Drains”>
</tab>
Use the id within the group tag to create a custom group. Similar syntax to the tab syntax.

Related

How can I determine if my VSTO ribbon is active in Word

I have a VSTO project that creates a ribbon tab in Word.
In this Stackoverflow link I can see how to force my ribbon tab to be activated.
No where can I find how to perform sort-of the reverse - i.e. I want to know whether my ribbon tab is active or not.
Can anyone tell me how to achieve this? How to determine whether the ribbon tab that I can activate is still active at any other stage of the user interaction with Word?
There is no way to do that using the Outlook Object Model. As a possible workaround you can use the Microsoft Active Accessibility.
The Fluent UI (aka Ribbon UI) doesn't provide anything for that. But you can use the GetVisibleMso method of the CommandBars class for checking whether a built-in controls is visible or not. You just need to pass the idMso value of the control to the method, see Office 2013 Help Files: Office Fluent User Interface Control Identifiers. But the best way to get the job done is to use callbacks in your custom UI markup. For example, the getVisible callback is invoked when controls are going to be shown on the ribbon (your tab is active). Thus, you will always know your tab is visible.

Is it possible to host a custom UI control inside of MS Word Ribbon

I have a VSTO add-in for Microsoft Word application. I can easily add controls from Office Ribbon Controls to the ribbon. Here I can also see the list of controls which can be added to the ribbon and all of them implementing RibbonControl interface. If for some reasons I want to add a totally custom UI control for example a label control which supports showing a text in different colors - is it possible to accomplish this by implementing RibbonControl interface? I have not found any kind of information which could help me to find the answer for this question myself so I will appreciate any help.
No. The Office Ribbon does not support using custom controls. Only the controls supported by the Ribbon XML specification are allowed.

How to insert custom fields in between Outlook's New Mail form?

We want to create an Outlook add-in which customizes the New Mail form (Message class) of Outlook such that our custom region appears embedded, below the attachments bar of Outlook, as shown in this mock-up:
So far, the options we've explored are Form Regions and Form Page customization. Form Page customization allows us to add controls at the required place, but the theme of the form is lost. Form regions, by limitation, cannot insert custom regions in between existing form.
How can this be achieved without changing the theme of the form? Please note, the add-in would be using C++ or .NET for coding.
The short answer is you cannot do it without changing the theme of the form. Regardless, I would not recommend building a solution using the legacy Custom Form approach. Custom TaskPanes are out as well as they can only dock to the window borders.
The long answer is the hard answer, using the Windows API to inject your UI: https://code.msdn.microsoft.com/OlAdjacentWindows. However, this approach is not supported.
The way forward for Outlook integrations are the new web based add-ins See here.. Granted, they won't allow you to integrate as nicely within the form, but the default Outlook task panes do actually integrate directly below that form, and on the positive side, it allows you to go cross-platform which would be impossible in any of the legacy extensions.

Custom Ribbons - per DOTM

we have a possible customer, who would like to have a custom ribbon in ONE template, which makes it for him easier to design the text etc.
This stuff should work on Office 2007, 2010 and 2013.
Since this will go to thousands of people, the easiest solution for this would be, to implement Macros, which do the Design-Stuff.
It seems to be no problem (I tested only with 2013) to create a custom ribbon and connect it to macros, it seems even to be possible to define custom Icons.
The real problem causess the Ribbon itself. Since, if I activate my custom ribbon, it's activated for all documents, I have to anyhow create a macro, which makes it visible JUST for one template.
Is this even possible, or is there a possibility to define a Ribbon per dotm? I didnt find anything about that, but what I found makes me nervous about the 2007, 2010, 2013 thing...
Or is it easier to create an Addin, which is kindahow compatible with alle 3 Versions?
Use Visual Studio and start a Word Template project. You can use VB if macros are to your liking or C#.
Your future documents will have to have the template attached for the ribbon to show up, which in my experience has proven to be a pain.
Alternatively you can create an addon that handles document-open events and checks if the document looks like what you expect it to look like. Heuristics can be very tricky if you don't have very specific indicators (such as an attached template, schema or content tags)
Another suggestion, which would most likely be acceptable to users, is to write an addon that shows and hides its main ribbon tab but has a ribbon button to "activate" the document and when you click that button (on another tab) it attaches your template or assigns some other persistent indicator to the document. This addon would also check each document when opened for that indicator and automatically show the actual ribbon tab when the document is recognized.

Add a custom Ribbon group to an existing custom Ribbon group in word 2007

How can I add a new group to an existing (3rd party) custom ribbon tab add-in? I know that I can add to out of box ribbons by specifying the Tabs idMSo value but how do I do that for a custom ribbon tab. I have already tried the ID value of the custom ribbon, but it juts duplicates the ribbon? have also tried idMso and idQ attributes passing in the required custom tab Id but no success.
I can add it to out of box tab group by specifying the idMso value but not to custom tab
regards
idQ is the right way to go. This attribute allows you specify a qualified id, i.e. an id within a namespace. Some namespaces such as mso are built in, but custom namespaces can also be specified.
The key is that you need a xmlns:foo="bar" attribute in your customUI element that matches the namespace declared within the customUI of the 3rd party add-in you are trying to extend.
For example, suppose I have the XML for the following 3rd party add-in:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mso:customUI xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui"
xmlns:foo="bar">
<mso:ribbon>
<mso:tabs>
<mso:tab idQ="foo:someTab" label="an extensible custom tab">
<mso:group id="someGroup" label="a custom group">
<mso:button id="someButton" label="button" />
</mso:group>
</mso:tab>
</mso:tabs>
</mso:ribbon>
</mso:customUI>
Now, I want to extend the existing foo:someTab with a new group in another add-in or template. I define a customUI in the new add-in, making sure to specify the same namespace attribute in the customUI element. I then reference the existing tab using idQ="foo:someTab":
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mso:customUI xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui"
xmlns:foo="bar">
<mso:ribbon>
<mso:tabs>
<mso:tab idQ="foo:someTab" label="an extensible custom tab">
<mso:group id="someOtherGroup" label="a different custom group">
<mso:button id="someOtherButton" label="a different button" />
</mso:group>
</mso:tab>
</mso:tabs>
</mso:ribbon>
</mso:customUI>
This results two groups on a single custom tab. The same approach can be used to extend groups and other container controls.
I learned this through careful study of the Office 2010 Ribbon UI XSD. Unfortunately, it's poorly documented outside of the XSD itself.
The ribbon stuff in word is a bit weird. Basically, the way I understand it is Word asks your add in one time, via GetCustomUI, for any custom UI, Ribbom declarations, backstage, etc that you want to include.
And that's the only chance you've got. You can't dynamically add buttons, once you've told word the XML for your custom UI elements. You CAN however, unhide hidden elements, so as to make it LOOK like you're dynamically adding elements to a ribbon.
The Prob with a third party ribbon is that Word has already gotten the Custom UI from the third party app, so it's likely your running up against the same issue that third party would have if they wanted to dynamically add a button to their own ribbon.
I believe Word takes extra steps to allow you to add buttons to "built in" ribbons, but that doesn't extend to Custom ribbons as far as I know.