How to access the context menu for attachments in outlook 2003? - c#

My requirement is to capture the click events in attachment item's context menu in Outlook 2003. I tried binding existing outlook item events but none of them fires at all. Is there a way to accomplish my requirement ? Is there a way to get hold of the context menu for attachments ?
Thank you

Outlook 2003 uses command bars. You need to use the OnUpdate event of the CommandBars class to find the context menu (if any).

Related

Outlook VSTO Add-in selected text and context menu in Mail subject

I'm writing an Outlook 2016 VSTO Add-in in c# to add some lookup functionality. I already managed to create a context menu item when right clicking in an email body. The code in the handler accesses the current selection and executes my lookup functionality. So far so good.Screenshot of working context menu
Now I also would like to add an item to the context menu when right clicking on the email subject (in the reading pane above the body). Although looking in "Office2016FluentUserInterfaceControlIdentifiers" I couldn't find the idMso.
Question 1: What is the idMso of this context menu?
Next problem is here that it also seems difficult to access the current selection - the way via ActiveInspector.WordEditor.Application.Selection.Text or ActiveExplorer.Selection[1].GetInspector.WordEditor.Application.Selection.Text did work for the Email body but not for the subject above.
Screenshot of selected text in subject
Question 2:How to access the current selection in the email subject?
Any help is appreciated.
Preview pane body - use Explorer.ActiveInlineResponseWordEditor.
Subject edit box - the best you can do is use Windows API to find the control's HWND and then retrieve the selection using EM_GETSEL message.

How to hide / disable / capture click event of outlook mail send button?

Is there an easy way to disable , hide and capture the event of click of outlook mail send button ? The solution has to be compatible with outlook 2007 and 2010 versions. Code examples will be appreciated.
Thanks.
You can handle the Send event of the MailItem class which is fired when the user selects the Send action for an item. Also you may find the ItemSend event of the Application class helpful. It is fired whenever an Microsoft Outlook item is sent, either by the user through an Inspector (before the inspector is closed, but after the user clicks the Send button) or when the Send method for an Outlook item, such as MailItem, is used in a program.
To disable or hide the button you may consider using a form region which can override the whole inspector region leaving the ribbon control intact (the Replace-all region type). See Creating Outlook Form Regions for more information. Also you may consider using Advanced Outlook view and form regions.

C#: Outlook Mailitem Changed

i am developing an Outlook AddIn for Outlook 2010 with VS 2010.
When the user opens some Mails, and he changes the focus from one mailitem to another: Is there any event which can give me the currently displayed/focused mailitem?
It looks like you are interested in the SelectionChange event of the Explorer class. It is fired when the user selects a different or additional Microsoft Outlook item programmatically or by interacting with the user interface.
If you switch between inspectors, you need to handle the Activate event of the Inspector class. It is fired when an inspector becomes the active window, either as a result of user action or through program code.

How to programmatically remove a menu context item in Outlook 2013

I have an Outlook add in that was written with Outlook 2010 in mind but I am updating to handle Outlook 2013 correctly. As part of the add in I have included a number of context menu buttons using the IRibbon method.
At this point these new menu items work correctly, however I wish to remove one of the default Outlook contxt menu buttons with right clicking on a mail item or document in a specific folder.
I have tried declaring a GetVisible event for the button in the Ribbon XML but this does not get fired like the GetVisibile calls I have for my new custom added buttons.
If anyone has any hints, tips or experience with disabling one of the default Outlook 2013 context menu options they would be much appreciated.
Having looked into this further, the "Delete" option I was looking to remove was a new addition on 2013, having originally thought the add in I was working with had removed it in 2010.
It shares the same behaviour as the "Delete" button in the main top ribbon and appears to be a menu item that cannot be removed on an item type basis, but you can suppress the behaviour of the button within the add in.

How to add context menu item to outlook when it in reading email mode

So, I want create add-in which can read selected word at email and send it to the API by clicking on context menu. As for text selection everything is clear. But I stuck in creating context menu.
I search the web and found that we need add contextMenu item into the ribbon xml with specific idMso
But which of then I don't understand.
P.S.
I found the document with Outlook controls names here http://www.microsoft.com/en-us/download/confirmation.aspx?id=6627
Ok, I found it! idMso="ContextMenuReadOnlyMailText"

Categories