none
Add Menu-Entry to Outlook Inspector RRS feed

  • Question

  • Hello,

    I'm trying to add a entry in the Contextmenu of the Outlook Mail-Inspector (Outlook 2010) using a Ad-In created with Visual Studio 2010.

    I tried using this XML-configuration:

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
      <ribbon>
      </ribbon>
      <contextMenus>
        <contextMenu idMso="ContextMenuMailItem">
          <button id="MyContextMenuMailItem"
          label="Das ist der Eintrag"
          onAction="OnMyButtonClick"/>
        </contextMenu>
      </contextMenus>
    </customUI>

    But, the new entry is only in the contextmenu of the Mails-List.

    How is it possible to add a entry to the menu that appears while performing a right-click on the mail content?

    Thx!

    Thursday, February 23, 2017 5:48 PM

Answers

  • I didn't see such idMso value before and thought it is not possible at all, but looks like it works:

     <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
       <contextMenus>
         <contextMenu idMso="ContextMenuText">
           <control idMso="Cut"
                    visible="false" />
           <control idMso="Copy"
                    visible="false" />
           <button id="customButton"
                   label="Click Me"
                   getImage="LoadCustomImage" 
                   onAction="OnButtonClicked" />    
           <toggleButton id="customToggleButton"
                         label="Toggle Me"
                         getImage="LoadCustomImage" 
                         onAction="OnButtonToggled" />    
         </contextMenu>
       </contextMenus>
     </customUI>

    Don't forget to return it at the appropriate context in the getCustomUI callback for inspectors.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    • Marked as answer by ChrissT82 Friday, February 24, 2017 8:12 PM
    Thursday, February 23, 2017 6:54 PM

All replies

  • Hello Chris,

    See Context Menu for the sample:

     <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
       <contextMenus>
         <contextMenu idMso="ContextMenuText">
           <control idMso="Cut"
                    visible="false" />
           <control idMso="Copy"
                    visible="false" />
           <button id="customButton"
                   label="Click Me"
                   getImage="LoadCustomImage" 
                   onAction="OnButtonClicked" />    
           <toggleButton id="customToggleButton"
                         label="Toggle Me"
                         getImage="LoadCustomImage" 
                         onAction="OnButtonToggled" />    
         </contextMenu>
       </contextMenus>
     </customUI>


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers


    Thursday, February 23, 2017 6:30 PM
  • Hello Chriss,

    To add custom items into message context menu you should use  ...

    <contextMenu idMso="ContextMenuText">
      

    Please se more at Customizing Context Menus in Office 2010

    You may also have a look at available customization points at Extending the User Interface in Outlook 2010


    Slava Ivanov

    Thursday, February 23, 2017 6:35 PM
  • Hello Slava,

    hm, I thought, I already tried this. Tomorrow, I will try it again, maybe I did a typing error.

    I have already read the 2 links, you postet. On the first they use the Custom UI Editor, but I was not able to get this working with Outlook.

    On the second, the describe the several menus, but I was not sure, which menu is the right one.

    Thx for your tips

    Thursday, February 23, 2017 6:45 PM
  • I didn't see such idMso value before and thought it is not possible at all, but looks like it works:

     <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
       <contextMenus>
         <contextMenu idMso="ContextMenuText">
           <control idMso="Cut"
                    visible="false" />
           <control idMso="Copy"
                    visible="false" />
           <button id="customButton"
                   label="Click Me"
                   getImage="LoadCustomImage" 
                   onAction="OnButtonClicked" />    
           <toggleButton id="customToggleButton"
                         label="Toggle Me"
                         getImage="LoadCustomImage" 
                         onAction="OnButtonToggled" />    
         </contextMenu>
       </contextMenus>
     </customUI>

    Don't forget to return it at the appropriate context in the getCustomUI callback for inspectors.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    • Marked as answer by ChrissT82 Friday, February 24, 2017 8:12 PM
    Thursday, February 23, 2017 6:54 PM
  • Hello Eugene,

    thx for your reply!

    What do you mean with:

    Don't forget to return it at the appropriate context in the getCustomUI callback for inspectors.


    Thursday, February 23, 2017 7:00 PM
  • The GetCustomUI should look like the following one:

    public string GetCustomUI(string RibbonID) 

    You need to check the passed argument (RibbonID) and return the markup only for inspectors.

    Also make sure that you don't get any UI errors, see How to: Show Add-in User Interface Errors for more information.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers


    Thursday, February 23, 2017 7:15 PM
  • Ok, I'll try that tomorrow and give you feedback. Thank you for your help!
    Thursday, February 23, 2017 7:21 PM
  • Hello, I tried it today, but "ContextMenuText" shows the entry in the contextmenu of the window, that opens, when clicking on "New Mail" or "Reply". I'm searching for a way to add it to the reading/preview pane context menu. Thx! Greetings, Chriss
    Friday, February 24, 2017 5:19 PM
  • Hello, I tried it today, but "ContextMenuText" shows the entry in the contextmenu of the window, that opens, when clicking on "New Mail" or "Reply". I'm searching for a way to add it to the reading/preview pane context menu. Thx! Greetings, Chriss
    Friday, February 24, 2017 5:19 PM
  • The subject of this thread is related to inspector, not explorer. 

    As far as I know there is no such idMso value published by MS. Anyway, you may try to use idMso values listed in the following documents:

    Office 2010 Help Files: Office Fluent User Interface Control Identifiers

    Office 2013 Help Files: Office Fluent User Interface Control Identifiers

    Office 2016 Help Files: Office Fluent User Interface Control Identifiers


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Friday, February 24, 2017 5:42 PM
  • Hello Chriss,

    The thread title indicate that you are looking for context menu extension for Inspector. You already get your answer for this question. If you have yet another question regarding extending context menu for read/preview an item you should create another thread, because those multiple answers for different questions in the same thread will mislead someone who would have the same question in the future and will looking for the answer in your thread.

    As for your additional question for customizing context menu when read the item please use the following ...

    <contextMenu idMso="ContextMenuReadOnlyMailText">


    Slava Ivanov

    Friday, February 24, 2017 8:09 PM