Ubuntu+Unity: text selection event - events

Subject: I have Ubuntu with Unity. I select text in different tools, like PDF Reader, Libre Office and so on. Can I get this event object (selection) somehow? I want to do some processing on this event.

Related

VSTO Outlook: Add new icon to the Outlook items shown in the explorer email list

On folder selection (Inbox, Deleted, Sent, etc.) the Outlook email items are shown listed in the explorer view as a list of Outlook items.
For each Outlook items, some icons (attach, etc.) are show on the right. How can I add new icons there for each outlook item? I want to do the same as explained here or here, but instead of changing an existing one, I would like to add a new one/s.
Additionally (this is optional) it would be great if I could execute some code when user clicks on it but I am ok if I can just show it.
UPDATE 05/10/2022
There are two posibilities:
Add new columns to the message grid preview in the explorer view, I mean put more columns at the beginning or after the last column (flag one). This view is obtained when you resize the width of the messages grid:
Use the existing last column of the messages grid preview, marked with a flag, and put there more icons with its click event handlers.
Is it possible to implement both above solutions?
There is no trivial way to inject custom icons there. The best what you could do is to use the PR_ICON_INDEX property with a set of predefined icons. The property contains a number that indicates which icon to use when you display a group of email objects.
As explained in the articles mentioned in your post you can use the PropertyAccessor.SetProperty to set up an icon for Outlook items.
Additionally (this is optional) it would be great if I could execute some code when user clicks on it but I am ok if I can just show it.
You can handle the SelectionChange event of the Explorer class which is fired when the user selects a different or additional Microsoft Outlook item programmatically or by interacting with the user interface. The Outlook object model doesn't provide any other events for that.
There is no way to add a new icon next to the old one - the message view in Outlook does not support that level of customization.
The only way to replace a build-in icon with a truly custom one (instead of using one from a few dozen predefined icons) is to create a custom form (even if exposes no customization) and specify an icon for that form. If the message class (MailItem.MessageClass) matches that of a custom form, Outlook will show your custom icon. Not ideal at all.

VSTO Outlook: Customize email inspector header without using form regions

When you open an email by doing double click on it, I would like to know is the top panel of the email (header - indicate in the screenshot with a blue rectangle -) can be customized by adding text or other controls. Also in the context menu that appears when you click on the three dots button, I would like to know if I can add some options there. If that possible. Below I attach a screenshot and I indicate there the places where I would like to place these things (see blue arrows).
Also I would like to do the same in the preview area where the mail is shown when you select it from the messages list.
The Outlook extensibility model doesn't provide anything for customizing these bits. There is no trivial way to get the job done. The best what you could do is to develop a form region (Replacement or Replace-All) which can substitute the whole inspector UI, so you could re-build it from scratch. Read more about Outlook form regions in the Walkthrough: Design an Outlook form region article.
Also you may consider putting a form region with your custom information at the top of the window, but right below this pane. See Advanced Outlook view and form regions from Add-in Express.

disable outlook VSTO plugin icon

I have requirement to disable outlook vsto plugin icon if user open email from saved location . its job is to select highlighted emails from outlook and saved to external crm . There is new requirement that if email is saved on disk and re opened again it still shows the outlook plugin incon , i have to disable the incon if email is opened from disk .
any idea how to achieve this . I user select any email from outlook it should be fine but if email is saved on disk outlook addin icon should be disabled.
Many thanks
As a rule, mail items opened from the disk don't have the EntryID property set. I'd suggest starting from the NewInspector event which is fired whenever a new inspector window is opened, either as a result of user action or through program code. So, you may check whether the EntryID exists and whether item is not composed one which means newly created in Outlook. The PR_MESSAGE_FLAGS property provides flags that can be used to identify whether it is read-only or composed item.
As for the Fluent UI, you need to use the IRibbonUI.Invalidate or IRibbonUI.InvalidateControl methods. You can customize the Ribbon UI by using callback procedures in COM add-ins. For each of the callbacks the add-in implements, the responses are cached. For example, if an add-in writer implements the getImage callback procedure for a button, the function is called once, the image loads, and then if the image needs to be updated, the cached image is used instead of recalling the procedure. This process remains in-place until the add-in signals that the cached values are invalid by using the Invalidate method, at which time, the callback procedure is again called and the return response is cached. The add-in can then force an immediate update of the UI by calling the Refresh method. The getVisible callback should be used for hiding and displaying the ribbon UI dynamically.
The Fluent UI (aka Ribbon UI) is described in-depth in the following series of articles:
Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

How to add an Outlook Add-In Button to the main Mail Overview

I'm trying to create an Outlook Add-In that will forward the selected mail message as an attachment when the button is pressed. Preferably this will work both for the Outlook Client, and Outlook Web Access. To do this, I need to add a button to the main UI in Outlook which shows the list of messages.
However, within the new Add-In format, I don't see an ExtensionPoint for Outlook that allows adding a button to the main mail UI.
https://learn.microsoft.com/en-us/office/dev/add-ins/reference/manifest/extensionpoint#extension-points-for-word-excel-powerpoint-and-onenote-add-in-commands
There are options for the MessageRead pane or the MessageCompose pane, but I don't see anything for the general overview.
However, the following New Feature complains that multiple mail items can't be selected with the add-in syntax, which seems to imply that a single mail item can be selected. If a single mail item can be selected, then that implies that there is a way to add a button to the overview mail page since that's the only place mail can be selected.
This makes me think it is possible to do this, but I'm not sure how.
Can someone please point me to how this might be done?
NOTE: I am NOT trying to create a COM plugin. That is the old format and I've noticed they're increasingly less reliable in Outlook 2016. I am trying to use the new format.
The MessageReadCommandSurface and MessageComposeCommandSurface extension points for Outlook applies to both the main Outlook window (the Explorer) and the item (Inspector) windows. The Explorer Ribbon buttons activate when an email is selected, so the buttons interact on the selected email. So you don't have to do anything if you've already defined those extension points.

Replace new mail editor box

With a VSTO add-in, is it possible to replace the Outlook 2013 new email body editor with something custom?
(What I want is MarkdownOutlook which is a good start but I want it to show side-by-side preview and better keystroke handling (like tab) closer to http://dillinger.io/)
Thanks!
You'd have to use custom forms to edit the UI of the IPM.Note message class and replace the Body control with another editor control. This is not a trivial thing to do as Word is the default editor and there is a very tight coupling with Outlook for message viewing/editing functionality.
Another alternative to customizing the message class is to create an Add-in Express or Outlook Form Region that replaces the default form UI entirely with your .NET Windows Form. But that's even more work as you'd need to recreate the message envelope controls for sending.

Resources