Displaying information bar in outlook application - outlook-addin

I have developed an outlook plugin using atl. I want to show some information to user using yellow bar which comes just below ribbon of application.
I have found one class for that in interop, but dont know how to use it. Its olkinfobar
If i create its instance than how to i bound it to application.
https://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.olkinfobarclass.aspx

You need to create a custom form to use this control.
Instead, you need to develop an Outlook form region or create an adjacent window. See Adjacent Windows In Outlook for more information about subclassing Outlook windows using Windows API functions.

Related

Call Word Menu-Button in VBA?

everyone,
I am new to VBA and would like to know if it is possible to execute a menu button from a WordAddIn.
In the picture you can see which button I would like to execute using VBA.
Unfortunately, I can't record it via macro.
The Word object model allows executing built-in ribbon controls using the CommandBars.ExecuteMso method which executes the control identified by the idMso parameter. This method is useful in cases where there is no object model for a particular command. Works on controls that are built-in buttons, toggleButtons, and splitButtons.
But in your case the control comes from a third-party add-in which doesn't expose IDs and the CommandBars.ExecuteMso method can't find it and invoke the command programmatically.
To get the job done you may consider using the Microsoft Active Accessibility which is a Component Object Model (COM)-based technology that improves the way accessibility aids work with applications running on Microsoft Windows. It provides dynamic-link libraries that are incorporated into the operating system as well as a COM interface and API elements that provide reliable methods for exposing information about UI elements.
Also you may contact the add-in vendor for providing public methods that can be called from your solution. That's also a possible workaround instead of calling UI elements on the ribbon.

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.

VSTO XML ribbon - is there a single instance of the ribbon?

I'm trying to understand some of the behaviors I'm experiencing in my custom outlook VSTO ribbon and the main difficulties I'm facing are tied to what seems to be a single instance of the ribbon being shared among concurrently open inspector windows (my custom ribbon is displayed for ribbon type "Microsoft.Outlook.Mail.Compose"). Is there indeed a single instance of the ribbon being shared among potentially multiple instances of inspect windows? If so, how do you handle concurrent different states in the different inspector windows?
What you do is create the one custom Ribbon and from each view you handle the items in the Ribbon that you need. Here is a question that somewhat relates to your question:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/57dc20bb-9d29-4d3e-84d2-c64de0af0244/iribbonextensibilitygetcustomui?forum=vsto
In your case you want to maintain state, that is using the same paradigm. Whenever you get focus on the composing mail you make sure the state of the Ribbon matches the state of the composing mail.
By doing so the one time loading of the Ribbon XML is no longer an issue as you have all items in one Ribbon and are able to manipulate the state for each of the composed mails.

Custom View for my plugin in Outlook 2010 / 2007

I'm working to load my WPF control into outlook as a plugin. The only way it allows me to do is to add a custom task pane (which works perfectly fine), which is kind of hard at the UI. To maintain Outlook consistency, I would like to add my own view in the right-view of Outlook, so if the user clicks on some item in the navigation pane, I show my view. This would allow me to show Outlook data in my custom implementation to enhance the UX.
Can someone please let me know how to do this?
-Fahad
Fahad,
Please google up "outlook form region". This sounds like exactly what you need - create your own form region (using outlook's developer tab) and re-register a specific mail for that.
example:
reg.Create(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Office\\Outlook\\FormRegions"))
Best of luck!
Nili

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.