I've got a minimal VSTO Addin for Outlook 2010 with a ribbon. My only goal is to display a ribbon (created via designer) with no functionality. From what little I can tell from MSDN ribbons should just automatically be displayed by default, perhaps with tweaking ControlIdType/CustomId properties for tabs.
Alas, tweaking these properties does nothing -- Outlook loads and displays no tab. A simple message box displayed in the ribbon loader reveals it never is triggered. Additionally, I haven't seen any information resources (tutorials, walkthroughs, overviews, etc..) that say anything about needing to manually tell Outlook to display tabs.
How do I get the tabs displayed?
Is there a good resource other than MSDN that's good for VSTO newbies?
To get your ribbon displayed, on the base ribbon in your code change the RibbonType property to be Microsoft.Outlook.Explorer.
What fixed it for me (without starting a new project), in the Ribbon1.vb ribbon design, I clicked on the the Ribbon1 name above the ribbons 'File' button, in the properties pane, clicked on tabs (collection), under the heading 'Design' I changed the name (from Tab1) to something else.
Clicked ok, tested by clicking F5 and it worked. Hope this helps someone else.
Related
I'm making an Outlook VSTO Add-In with a ribbon and the ribbon stopped loading. I'm using the Ribbon (Visual Designer). It was loading fine, I made some code changes, fired up a new session, and it wouldn't load. There is no "Add-Ins" item in the ribbon.
I think the problem is in my Outlook, not in my project.
I created a new project to make sure there wasn't something wrong with my larger project, using the most basic code with no code in the addin class and only a single group in the ribbon. It still won't load.
ThisAddIn_Startup is firing, so I know the addin is loading in Outlook
I've tried both Ribbon Designer and XML
RibbonType is set to Microsoft.Outlook.Explorer
I've deleted all .vsto files and removed references in the registry
I've rebooted
First of all, I'd suggest making sure you don't have any ribbon UI errors at runtime. Here is what MS states:
By default, if a VSTO Add-in attempts to manipulate the Microsoft Office user interface (UI) and fails, no error message is displayed. However, you can configure Microsoft Office applications to display messages for errors that relate to the UI. You can use these messages to help determine why a custom ribbon does not appear, or why a ribbon appears but no controls appear.
See How to: Show Add-in user interface errors for more information.
Make sure that you did all the steps described in the following articles (one of them):
Walkthrough: Create a custom tab by using the Ribbon Designer
Walkthrough: Create a custom tab by using Ribbon XML
If you use the ribbon XML approach you can set up a breakpoint in the ribbon's getCustomUI callback to make sure the callback is invoked and what ribbon XML is returned.
I've created a custom add in for Outlook 2010. When I hover over the button, there's a help section with a cog image that says Press F1 for Add-in Help. I would like to remove this so it's not visible when the user hovers over the button but can't find where/how to do so.
The Office extensibility model doesn't provide anything for that. You can try to use Windows API functions to get the job done.
I have created an Outlook Add-In that adds a button to the ribbon of a new email window, but it's causing a problem.
Here is what happens:
User has Outlook Open.
User opens Excel.
User sends excel document to someone via File->Save and Send->Send as Attachment
User makes a change to the document
User attempts to close the document
This is when Outlook prompts the user to save the file, but the dialog box is hidden behind the Excel window and the user can't get to it without doing some shenanigans.
My Outlook Add-in does many other things, but I've pinned it down to the Ribbon.cs file I created to add a button to the new email window. When I change the RibbonType property of the OfficeRibbon object from Micorosft.Outlook.Mail.Compose to nothing, the Save Dialog shows as it should. When I change it back to "Compose", it hides the dialog box again.
Does anyone know of any way around this? I have confirmed this happens when the project is either an Outlook 2007 Add-In or an Outlook 2010 Add-In.
Thanks in advance.
So in reference to the link sent by user1217053 the answer would probably be along the lines of...
create a class scope field for the Outlook.Mailitem
have it bind to the BeforeClose event.
Inside the BeforeClose event handler for this field, add code such as ...
cMailItem_BeforeClose(bool Cancel)
{
var Insp = cMailItem.GetInspector();
Insp.Close();
Marshal.FinalReleaseCOMObject(Insp);
Insp = null;
}
Then hopefully this will get rid of the shadow inspector.
I dont know if you are still working on with this problem or not, but I faced the exact same problem and then found the solution. You must be using the Ribbon designer just like I was. The ribbon designer cause this problem. I had to change from Ribbon designer to Ribbon XML. It was a little bit of work to remove code and change some logic, but that fixed the problem. I heard the other altenative is to use a wrapper class.
Hope this helps.
In Outlook 2007 you have the navigation panel, consisting of "Mail","Calendar","Contacts","Tasks" etc (this is all below the tree structure).
1) Is it possible (and if so, how?) to insert another user-defined button between, say, "Mail" and "Calendar"?
2) Programatically, how could I minimise the main pane? So if I was in "Mail", the main pane would be "Inbox".
I have been using Add-in Express for customisation, but I dont believe it can do the above and could be a general .NET question.
Do you mean create an additional button inside Outlook, or reuse the button styles/etc in a 3rd party application?
If you mean inside Outlook, then yes, Outlook 2010 (not 2007) provides some OM hooks to add 1 additional button here. It's called the Solutions module. If there is only one solution installed, the name of the button takes the title of the solution. If there are multiple solutions then the title reverts to "Solutions"
If you mean outside of Outlook, then no. It's not possible. These buttons are not COM components (in fact, they're not even proper HWNDs).
1.) You cannot create new Navigation Modules in the Navigation Pane. See MSDN forums for related question.
2.) An Outlook View Control will let you takeover the currently active view pane.
I am developing an Office add-in. Due to some limitations of ribbon controls (e.g. menuSeparator has no visibility control or splitButton cannot host a dynamicMenu only a menu), I need to be able to cause the Office app to reload the ribbon by repeating a call to my add-in's IRibbonExtensibility.GetCustomUI.
Is this possible?
As far as I know ribbon add-ins, this would require to stop and then restart your add-in. There must be a way to do so given that one can access the list of add-ins in outlook. you could run another instance of your add-in which would first close the previous one, then return the updated ribbon XML. But this means that it would not be applicable while the user is clicking on the ribbon's components, and you would have to save all your data somewhere and then read it to restore the add-in status. In addition, the user may see the ribbon disapearing and appearing again, which may not be appreciated.
Would the Ribbon.Invalidate() method work for your use case? I frequently use it to refresh the ribbon when I've dynamically added/removed items.
For example, in the Ribbon c# file (Ribbon1.cs by default):
this.ribbon.Invalidate();
When the ribbon needs to be refreshed. This assumes you've set this.ribbon in the Ribbon_Load method.