Which RibbonType will show my custom Ribbon for a sent message in Outlook (2013) VSTO Add-In? - vsto

New here so please forgive any faux pas!
I have an Outlook VSTO Add-in with a custom ribbon which I currently display only on composing a new message or replying to a message.
I've selected Microsoft.Outlook.Mail.Compose and Microsoft.Outlook.Mail.Read in RibbonType, and my ribbon appears fine on creating a new message or replying, but not when I go to Sent and open a message.
Can anyone point me in the right direction as to where I can find a list of the RibbonTypes and what they relate to, or offer any advice?
Thanks!

Most probably you get a Fluent UI error.
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.
You could use any idMso value which exists on the compose window and doesn't exist on the read inspector.

Related

How to access "message bar" in Outlook?

When I enable "Out Of Office" automatic messages in Outlook 2010, the "message bar" is filled in with a warning text. I would like to use such a feature to inform the user of my own feature being enabled.
I cannot find any reference to programmatic access to this bar. I found something about the statusbar, but it is not usable in VBA in Outlook.
I am not even sure the proper English name of this feature is "message bar"; I am referring to the same bar which in Word is used to inform user that a document is "dangerous" because coming from internet.
Is this message bar exposed in VBA for Outlook?
I tried finding other methods to inform the user, so I started studying the Ribbon: if I could make my own tab visible I could use it as a "message bar", but Ribbon is managed by Outlook differently from other Office programs, so most of examples available around are not applicable/working in Outlook.
I was able to programmatically create a tab and add a button to it, but then I can't make the tab visible.
I also tried using property "position" of the commandbar: not just msoBarTop but also msoBarBottom or msoBarPopup, but Outlook ignores my efforts.
But maybe managing the Ribbon in Outlook with VBA should be addressed in a separate question (there are some questions about it here, but I could not find useful tips for me; I have no access to VB VSTO).
The area you are referring to is used to implement Mail Tips. Although you can create custom ones through the Exchange Admin Center , they cannot be interacted with via code.
Manipulating Ribbon controls to show states or user messages is not really recommended, as the Ribbon is generally a static thing (except in case of menus, dropdowns and Galleries).
If your goal is to show a transient alert, a better approach would be to use the Windows SDK to show Windows notifications. If having your alert hosted in Outlook is of the utmost importance, then look into using Form Regions or an add-in with Task Panes to display your messaging. Or even a simple VBA MessageBox or User Form.
Also note that your usage of the CommandBar is really only applicable to Outlook 2007 and earlier - there are no more CommandBars in newer versions, just the Ribbon.

Accessing Outlook COM addins

I am a novice at programming and it is my first time trying to program a plugin for outlook, which I am having issues with.
When using Application.COMAddIn("addinname").Update I get the error that COMaddin is not a member for Application. Reading Microsoft documentation seems to state that it is a member of Application.
I'm guessing this is a stupid mistake, any help will be greatly appreciated.
It is Application.COMAddIns (plural). But COMAddin object does not expose the Update method.
To see Outlook objects and their methods and properties, use OutlookSpy (I am its author) - in your particular case, click Application button on the OutlookSpy ribbon, select COMAddins property, click Browse. In the COMAddins window, go to the IEnumVariant tab and double click on an addin.

VB.net - Form won't show

My problem concern an application which is currently running in production since 6 months. But last week, one user reported me this :
Above all, this application is a complement to Outlook, which allows users to create, edit and delete tickets through a new tab in the ribbon.
When this user clicks on a button (Create), a window is supposed to appear. In my code, this window is used in two places, one to create the ticket and the other to edit the ticket. When the user wants to edit a ticket, this window appears without problem. But just to create, he won't appear.
I call the window like this for creating :
Dim oForm1 As Create_form
oForm1 = New Create_form(Nothing)
oForm1.Show()
And like this for editing :
Dim oForm1 As Create_form
oForm1 = New Create_form(ticket)
oForm1.Show()
And here is the constructor :
Public Sub New(ticket As Ticket)
InitializeComponent()
MaximizeBox = False
actualTicket = ticket
Init_List()
Init_Fields()
End Sub
I have looked for solutions on the Internet, but it seems I am the only one with this problem. This code worked for this person until last week without any change.
One possibility I thought about is the Microsoft redistributable and the Outlook version (Developed and tested on Outlook 2016, used on Outlook 2013...).
Any ideas ?
Thanks for your help !
Ps : Please excuse my more than average English
First of all, make sure your add-in is enabled and running in Outlook.
Microsoft Office applications can disable VSTO Add-ins that behave unexpectedly. If an application does not load your VSTO Add-in, the application might have hard disabled or soft disabled your VSTO Add-in.
Hard disabling can occur when a VSTO Add-in causes the application to close unexpectedly. It might also occur on your development computer if you stop the debugger while the Startup event handler in your VSTO Add-in is executing.
Soft disabling can occur when a VSTO Add-in produces an error that does not cause the application to unexpectedly close. For example, an application might soft disable a VSTO Add-in if it throws an unhandled exception while the Startup event handler is executing.
When you re-enable a soft-disabled VSTO Add-in, the application immediately attempts to load the VSTO Add-in. If the problem that initially caused the application to soft disable the VSTO Add-in has not been fixed, the application will soft disable the VSTO Add-in again. Read more about that in the How to: Re-enable a VSTO Add-in that has been disabled article.
Most probably the form is displayed behind the Outlook window. To show a form on top of the Outlook window you need to specify the parent window handle. In .net based applications or add-ins you typically use Windows forms classes to show a window. The Show and ShowDialog methods of the System.Windows.Forms.Form class accept an instance of the IWin32Window interface which stands for the parent window handle. See How to set the Window.Owner to Outlook window for more information.
Finally I found the solution, for the creation of one ticket, I'm using the system date with a specific function. But, the user who have the problem change the default setting in the Windows configuration. So the form could not be displayed due to an unmanaged exception (English date when the software expect French date).

VBA when user clicks Send as Attachement

My company has an issue with Outlook when it is triggered to open by Excel that causes Outlook to hang indefinitely when loading (an issue which cannot be easily fixed). We have a few workbooks with custom ribbons where we now check that Outlook is open first before allowing the user to send via email. The problem is that this doesn't account for users that still use the File > Save & Send > Send as Attachment.
I would like to know if anybody knows about a process by which I can add on a routine to the existing button that we could save as an Excel Add In on everyone's Excel that checks first if Outlook is open? I have the Outlook check written so I'm just needing help with finding a way to run it.
Any help is appreciated.
Alternatively you could disable Send as Attachment.
I wouldn't know what is important so I won't copy parts here.
How do you disable “Save and send” in Excel 2010 (in the File ribbon (called backstage in Office 2010)?
Disable the Send button in the Office Menu
You may consider repurposing the ribbon controls. See Temporarily Repurpose Commands on the Office Fluent Ribbon for more information.
Unfortunately the Backstage UI doesn't allow to repurpose controls from the XML markup. You may consider hiding the built-in UI and rebuilding it fully with custom commands. Thus, you will be able to handle the commands on your own. You can read more about that in the Introduction to the Office 2010 Backstage View for Developers article. Also see the Customizing the Office 2010 Backstage View for Developers article.

Show Outlook Advanced Find dialog from .NET

When using Outlook 2007 or 2010 you can bring up the Advanced Find dialog by pressing Crtl+Shift+F.
I have performed advanced queries against Outlook contact items and calendar items, but would like to show Outlook's native dialog box for users to perform more advanced searches instead of trying to recreate that dialog box within my app.
I've searched, but have been unable to find details on how to show that dialog box from within a .NET application.
Not sure why I didn't get the Tumbleweed badge for this question, but I got the answer over on the MSDN forums.
http://social.msdn.microsoft.com/Forums/en-US/outlookdev/thread/fe1b7a52-18a3-47d2-a1eb-c22f5c57d454
The Advanced Find dialog is not exposed in Outlook's object model and therefore cannot be called from a .NET app.
So, I'm working on re-creating the dialog box in WPF.