Show Outlook Advanced Find dialog from .NET - vsto

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.

Related

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

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.

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.

Outlook Web Add-in: Can we add an entry into context menu?

I didn't find this functionality in Outlook web add-in documentation. But it's worth to ask...
We want to add a new entry into Outlook right click menu (context menu), so that it can open a hyperlink (url is different based on what you highlighted) to integrate with our web portal.
I understand contextual outlook add-in is the closer solution.
But it's not the user experience we want.
Instead of highlight everything based on RegEx, we would like to support users to intentionally trigger the add-in by highlighted keyword and right click on the context menu.
Wondering if it's possible today for the latest Outlook desktop app.
User scenario:
User highlights a keyword in email reading/writing mode
User right click the mouse
The context menu shows up with having our custom menu item
When user clicks on our custom menu item, it opens a browser with an url based on what user highlighted.
Outlook context menu cannot be extended at the moment. Available extension points are:
MessageReadCommandSurface
MessageComposeCommandSurface
AppointmentOrganizerCommandSurface
AppointmentAttendeeCommandSurface
Module (Can only be used in the DesktopFormFactor.)
MobileMessageReadCommandSurface
Events
DetectedEntity
You probably should add your business case into Office development user voice request: Outlook Web Add-in: Add Context Menu Mail Item Extension Point or at least upvote it.

is it possible to add a button to the right-click context menu for a user in Outlook 2010 using VBA?

I've tried many things and read up quite a bit but I cannot figure this out.
I cannot create an add-in so I have to use VBA.
I want to add a a button to the right-click context menu when I right-click on a user. Is this possible?
Yes, it is possible to customize the context menu in Outlook. See Customizing Context Menus in Office 2010 for more information.
But VBA doesn't allow to customize the Fluent UI in Outlook, you need to develop an add-in instead.

Word Add-in - find if dialog has focus?

I am writing a word add-in in VB .NET (using Add-in Express, but I don't think that's relevant).
I have created shortcuts, but I only want them to take effect if the document itself is in focus, not a dialog - for example, "Find and replace" or any other.
How do I determine if a dialog has focus?
The "Selection" property of the application points to the selection in the document, even if a dialog is currently selected. I can't find any "HasFocus"-equivalent property anywhere either. I'm running out of ideas :o)
Thanks!
This workaround worked for me:
My add-in keeps a reference to the handle of the most recently activated Word window, by using the GetActiveWindow API during the WindowActivate event of the Word application. This is necessary since, up until Office 2013, the Window object does not expose a handle property.
When a shortcut is triggered, I compare that to the handle of the currently active window, using the same API. If they don't match, I simply don't proceed :o)