How to programmatically remove a menu context item in Outlook 2013 - c#

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.

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 position a newly added Add-On in the outlook

I have created a new add-on for Outlook and I created a setup file aslo. while installing my Add-On, The ribbon appearing in the last. I want to position it first. Please help...
You can change the order of custom tabs on a Ribbon by using the Tab Collection Editor
Click here for more details

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"

Outlook 2010 folder context menu not being displayed except when folder is selected

I'm customizing context menu for our Outlook AddIn and I'm using ribbon xml. That customized context menu should be displayed only on our solution's folders. Problem is, the function I specify for getVisible callback is being called only when our folders are selected, and then right-clicked. But if for example Inbox is selected and I right-click on one of our folders, that function is not being fired and I see only the default context menu.
My bad. I was checking the current folder, instead of current Selection. After I changed my function so it casts IRibobnControl object into Selection, and then used it's contents, everything is OK

Custom Ribbon in VSTO Addin for Outlook 2010 doesn't display

I've got a minimal VSTO Addin for Outlook 2010 with a ribbon. My only goal is to display a ribbon (created via designer) with no functionality. From what little I can tell from MSDN ribbons should just automatically be displayed by default, perhaps with tweaking ControlIdType/CustomId properties for tabs.
Alas, tweaking these properties does nothing -- Outlook loads and displays no tab. A simple message box displayed in the ribbon loader reveals it never is triggered. Additionally, I haven't seen any information resources (tutorials, walkthroughs, overviews, etc..) that say anything about needing to manually tell Outlook to display tabs.
How do I get the tabs displayed?
Is there a good resource other than MSDN that's good for VSTO newbies?
To get your ribbon displayed, on the base ribbon in your code change the RibbonType property to be Microsoft.Outlook.Explorer.
What fixed it for me (without starting a new project), in the Ribbon1.vb ribbon design, I clicked on the the Ribbon1 name above the ribbons 'File' button, in the properties pane, clicked on tabs (collection), under the heading 'Design' I changed the name (from Tab1) to something else.
Clicked ok, tested by clicking F5 and it worked. Hope this helps someone else.

Categories