Outlook AddIn context menu does not recognize MailItem

Hi, 
  I just start program for Outlook in Visual Studio. I plan to start from creating right click menu in Outlook Home email panel.  I got the example code from
Context Menu for a Mail Item of
Extending the User Interface in Outlook 2010. When I test it, I select a email in Outlook, right click my context menu item, it does not think it's a MailItem. What's wrong in my code? How I can debug it? Do you know any good book/blog/example/tutorial? 
  Here is the code:     
<contextMenus>
<contextMenu idMso="ContextMenuMailItem">
<button id="MyContextMenuMailItem"
label="OAIContextMenuMailItem"
onAction="OnMyContextMenu_Click"/>
</contextMenu>
</contextMenus>
public void OnMyContextMenu_Click(Office.IRibbonControl control)
System.Windows.Forms.MessageBox.Show("Your Context Menu Works!");
if (control.Context is Outlook.Explorer)
Outlook.Explorer explorer = control.Context as Outlook.Explorer;
Outlook.Selection selection = explorer.Selection;
if (selection.Count == 1)
if (selection[1] is Outlook.MailItem)
Outlook.MailItem oMail = selection[1] as Outlook.MailItem;
//return oMail.Sent;
System.Windows.Forms.MessageBox.Show("Sent");
else
System.Windows.Forms.MessageBox.Show("Not MailItem");
else
System.Windows.Forms.MessageBox.Show("Multiple selection");
else if (control.Context is Outlook.Inspector)
Outlook.Inspector oInsp = control.Context as Outlook.Inspector;
if (oInsp.CurrentItem is Outlook.MailItem)
Outlook.MailItem oMail = oInsp.CurrentItem as Outlook.MailItem;
//return oMail.Sent;
System.Windows.Forms.MessageBox.Show("Sent at Inspector");
else
System.Windows.Forms.MessageBox.Show("Not MailItem at Inspector");
else
System.Windows.Forms.MessageBox.Show("not a Explorer/Inspector");
Thank you so much
Wes
Wes

Can you try to retrieve the Class property using reflection?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available!

Similar Messages

  • The item Hierarchical Context Menu does not support pre-calculation

    Hello,
    Trying to download pre-calculated web templates via RepAgent, using the Hierarchical Context Menu feature within the template (populated via control query with Hierarchy) the system returned the following message upon file download:
    "The item Hierarchical Context Menu does not support pre-calculation"
    As a result the Hierarchical Context Menu is not displayed on the downloaded html-files. Navigation not possible.
    Could not find any constraints documented in the online help, at this point.
    Question: is there something missing on our setup or is this really out of scope for precalculation with navigation?
    Any other experiences on that or shall we open OSS-message?
    Best regards,
    Markus
    (We are on BW3.1)

    Hi,
    we have the same problem. Does anybody have any hint or workaround? Is there a solution for this in 3.5 or any upcoming version.
    Any input is appreciated.
    Thanks,
    Stefan

  • Right click context menu does not appear only for Java 1.7, AWT TextField

    I have been debugging some issues that an application has been having with Java 1.7 versus older versions. A new problem I have encountered is that the right click context menu does not function in any TextField. It works fine when running/compiling it with any previous version of Java. I have tried coding a simple test with a Frame, Panel and TextField to see if it might be something else in the more complex application that was causing it, but the simple test class has the same problem.
    I have searched for other people having the same issue, but I have not found anything comparable. This seems like a huge change from one version to the next and I am surprised that I am not finding this mentioned anywhere else. Can someone point me to anything that discusses this issue that I am having? Does 1.7 require I implement my own context menu? I realize AWT is old technology, but this is an old, fairly complex application that doesn't use swing, and that is not going to change at this point.
    My simple test:
    import java.awt.*; 
    import java.awt.event.*; 
    import java.util.*; 
    class testF3 extends Panel 
      public static void main(String args[]) 
        Frame f = new Frame(); 
        Panel p = new Panel(); 
        f.setLayout(new BorderLayout()); 
        f.add("North", p); 
        TextField tf1 = new TextField("", 20); 
        p.add(tf1); 
        Dimension medm = f.getSize(); 
        medm.height = 100; 
        medm.width = 200; 
        f.setSize(medm); 
        f.setVisible(true); 

    In the past few days since upgrading to 4.0.4, the entire right-click context menu for links is gone and replaced with one item: "Copy Link" The "Open In New Tab" item, along with some other context items, is no longer there.
    That's actually a problem with your particular installation of Safari, b. I've got all the contextual menu entries with my 4.0.4.
    I helped fix one of these recently here at the forum. Try the procedure from the following post (it got back Tho's missing contextual menu entries):
    http://discussions.apple.com/thread.jspa?messageID=10598385&#10598385

  • MW64,  cs6 bridge when I move or copy files the  context menu does not retain  recent folder destinations after I close the program

    W64,  cs6 bridge when I move or copy files the  context menu does not retain  recent folder destinations after I close the program. The context options that show are the ones from original install. The workspace I set up is also gone. I have every explorer box and cleaner checked to save recent. Had to disable nivedia desktop software because of weird display conflict. Have Dell pro support and they cannot fix. Any ideas to help me with this would be appreciated.

    Self-solved!  I work in column view in Finder so get there in a Finder window with folders and files appearing.
    There really is no problem, just select an ITEM in the COLUMN before right-clicking!
    The "old" context menu will appear. If you click in the white space in that column (or anywhere in a Finder window) and then place the cursor over a folder or file WITHOUT selecting it and right-click you will bring up the secondary context menu - Open, Copy, Duplicate, View Options and a greyed out Labels option. No "Move to Trash".

  • The context menu does not work

    Hello Everyone,
    I have a problem when I try to use  the context menu.
    Just it does not work using control key and click, for example when I select a folder and I want to apply a color
    for the folder the context menu does not work.
    Thank you if anyone has an idea of how can I restore the normal function.
    Adrian

    /Library/Preferences/com.apple.finder.plist 

  • Context menu does not appear on first row of apps

    If I invoke the context menu, using the keyboard (Shift+F10/context-menu key), on any app in the first row of its category, no menu appears. The same app, if moved to the second row by resizing iTunes shows the normal context menu.
    Does anyone else have this issue, on Windows or Mac?
    Message was edited by: Soumya92

    make sure you are running the latest update and that nba leauge pass is availible in your country (if not in the usa)

  • Delete datagridview row using right click context menu does not behave like the delete key

    I have a datagridview with editing enabled. If I click the row header and press the delete key, the row is removed no questions asked. I don't recall doing any coding to make this happen but I couldn't do copy and paste using keys so I created a context
    menu with copy, paste, & delete.  The delete option calls
    dgvVX130.Rows.RemoveAt(dgvVX130.SelectedRows[0].Index);
    The row is removed but the problem is this fires other events like RowValidating which fails.  I presume because the row is no longer there.
    The delete keypress is definitely a lot cleaner so my question is 3fold. 
    1) Why doesn't Rows.RemoveAt behave like the delete key? 
    2) Is it possible to issue a delete keypress to do the same thing?
    3)  Is it possible to suppress the RowValidating event or other events when Rows.RemoveAt is fired?

    Interesting.  My delete key does not fire the row validating event.  When I use the delete key I click on the row header which does fire the row validating event and then I press the delete key.  Row is deleted and no event fires.  Works
    just the way I want it to.  I wish my context menu delete worked that way.  I wouldn't know what chunk of code I can provide to show the Row Validating NOT firing when delete key is pressed but here is the context menu code that does fire Row Validating.
    private void cmsEditItemClick(object sender, ToolStripItemClickedEventArgs e)
    ToolStripItem item = e.ClickedItem;
    switch (item.Text)
    case "Copy":
    if (dgvVX130.GetCellCount(DataGridViewElementStates.Selected) > 0)
    try
    // Add the selection to the clipboard.
    Clipboard.SetDataObject(
    dgvVX130.GetClipboardContent());
    // Replace the text box contents with the clipboard text.
    catch (System.Runtime.InteropServices.ExternalException)
    MessageBox.Show("The Clipboard could not be accessed. Please try again.");
    break;
    case "Paste":
    if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text) == true)
    ClipboardUtils.PasteFromClipboard(dgvVX130);
    dgvVX130.NotifyCurrentCellDirty(true);
    dgvVX130.EndEdit();
    dgvVX130.NotifyCurrentCellDirty(false);
    bindingSource1_PositionChanged(this, e);
    break;
    case "Delete":
    dgvVX130.Rows.RemoveAt(dgvVX130.SelectedRows[0].Index);
    break;
    default:
    //code
    break;
    private void dgvVX130CellContentClick(object sender, DataGridViewCellEventArgs e)
    //dgvVX130.IsUserSelectionEnabled = true;
    dgvVX130.BeginEdit(false);
    ((TextBox)dgvVX130.EditingControl).SelectionStart = 0;
    //((TextBox)dgvVX130.EditingControl).SelectionLength = 3;
    public class ClipboardUtils
    public static void PasteFromClipboard(DataGridView grid)
    try
    char[] rowSplitter = { '\r', '\n' };
    char[] columnSplitter = { '\t' };
    // Get the text from Clipboard
    IDataObject dataInClipboard = Clipboard.GetDataObject();
    string stringInClipboard = (string)dataInClipboard.GetData(DataFormats.StringFormat);
    // split into rows
    string[] rowInClipboard = stringInClipboard.Split(rowSplitter, StringSplitOptions.RemoveEmptyEntries);
    // get current cell
    int currentRow = grid.SelectedCells[0].RowIndex;
    int currentColumn = grid.SelectedCells[0].ColumnIndex;
    // get 1st cell in selected area
    for (int i = 1; i < grid.SelectedCells.Count; i++)
    if (currentRow > grid.SelectedCells[i].RowIndex)
    currentRow = grid.SelectedCells[i].RowIndex;
    if (currentColumn > grid.SelectedCells[i].ColumnIndex)
    currentColumn = grid.SelectedCells[i].ColumnIndex;
    // add more rows if need to paste data
    /* if (grid.Rows.Count < rowInClipboard.Length + currentRow)
    grid.Rows.Add(rowInClipboard.Length + currentRow - grid.Rows.Count); */
    // paste
    for (int iRow = 0; iRow < rowInClipboard.Length; iRow++)
    if (iRow + currentRow < grid.Rows.Count)
    string[] cellsInRow = rowInClipboard[iRow].Split(columnSplitter);
    for (int iCol = 0; iCol < cellsInRow.Length; iCol++)
    if (grid.ColumnCount > currentColumn + iCol)
    DataGridViewCell currentCell = grid.Rows[currentRow + iRow].Cells[currentColumn + iCol];
    if (!currentCell.ReadOnly) // H.NH added to avoid Read only case.
    if (cellsInRow[iCol] == "")
    if (grid.Columns[iCol].ValueType.Name == "String")
    currentCell.Value = null;
    else
    currentCell.Value = DBNull.Value;
    else
    currentCell.Value = cellsInRow[iCol];
    switch (iCol)
    case 3:
    currentCell.Value += "_ChangeColumnName";
    break;
    case 2:
    currentCell.Value = grid.Rows[iRow].Cells[iCol].Value;
    break;
    else break;
    catch (Exception e)
    MessageBox.Show("Sorry, can not paste from the clipboard.\nError: " + e.Message, "Paste Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

  • My right click is not working. the context menu does not come up and i can no longer drag files/folders. I have checked the mouse and track pad in system preferences and the correct boxes are all checked (with a support member). Please can you help

    My right click is not working and producing the context menu or ability to drag files and folders. I just spoke with a phone support person and we checked that all the mouse/trackpad options for right click were correct and checked.
    Please can you help with this.
    It has only just happened in the last few days.
    Many thanks

    You might want to update your profile so that we can see what model iMac you have and what version of OSX you're running.
    For this question, it might help to know if you're dealing with a trackpad, Magic Mouse, or something else?
    (Until your issue's resolved, you can Control-Left Click to get the right click functionality).

  • Java swing popupmenu / context menu does not appear in secondary monitor

    Main screen left
    second screen right
    swing portal application is visible on two screens.
    If you open a context menu (right mouse) on the right screen, the context menu open on the left (Main) screen instead of the right.

    Thank you very much for the replying.
    The below are my use cases :
    1. JDK 7 used.
    2. OS - Ubuntu/windows XP/2008
    3. Tested with extending more than 1 monitors, i.e. Laptop / primary monitors are attached with other secondary monitors attached and then running swing portal        application.
    4. This happens when you use "Extended Desktop" with two screens.
        Main screen left
        Second screen right
        Portal is visible on two screens.
        Open a context menu (right mouse) on the right screen, the context menu open on the left (Main) screen instead of the right
    The below is the sample of code of the file that actually open up the popups. The bold italics methods are the call hierarchy that are responsible to finally call the showPopupMenu().
    private synchronized void handleMouseEvent( final IDirNodeMouseEvent e ) {
            if ( e.getMEvent().isPopupTrigger() ) {
                Thread thread = new Thread(
                        new Runnable() {
                            public void run() {
                                JNDITreeNode node = (JNDITreeNode) e.getNodeAtEventLocation();
                                System.out.println(" --- handleMouseEvent ---");
                                createPopupMenu(e.getMEvent().getPoint(), e.getMEvent().getComponent(), node);
                thread.start();
    private synchronized void createPopupMenu(final Point point, final Component c, JNDITreeNode node) {
            contextMenuDN = node.getDn();
            CursorHelper cursorHelper = CursorHelper.showWaitCursor(c);
            com.marconi.platform.cvb.bcmp.security.AbstractDNPanel.registerJndiTreeNode(node);
            ContextMenuFactory contextMenuFactory = new ContextMenuFactory ( context );
            contextMenuFactory.setAttributeViewDisplayText(node.getDisplayText());
            TreeNodeDescriptor treeNodeDescriptor = new TreeNodeDescriptor(
                    node.getDn(),
                    node.getDirData()
            boolean searchContextAvailable = true;
            JNDIData data = node.getDirData();
            Attributes attrs = data.getAttributes();
            Attribute a = attrs.get("mSearchContextAvailable");
            try
              if (a != null)
                    String value = (String)a.get();
                    if (value.equalsIgnoreCase("FALSE"))
                        searchContextAvailable = false;
            catch (NamingException ne)
            jMenuItemSearch.setEnabled(searchContextAvailable);
            JPopupMenu menu = contextMenuFactory.getPopupContextMenu( treeNodeDescriptor );
            menu.addSeparator();
            menu.add( jMenuItemCollapseAll );
            menu.add( jMenuItemSearch );
            if ( contextMenuDN != null ) {
                menu.add(jMenuItemUpdate);
            MUtils.showPopupMenu(menu, point, c);
            cursorHelper.showDefaultCursor();
       * MUtils ensures that the whole popup menu is visible, performs a cleanup before showing.
       * @param popupMenu the menu to be shown
       * @param mouseClickPoint where the mouse has been clicked
       * @param c the component on which to show the popup menu
       * @see cleanupMenu
        public static void showPopupMenu( final JPopupMenu popupMenu, final Point mouseClickPoint, final Component c) {
        if ( popupMenu.getComponentCount() == 0 ) return;
        cleanupMenu( popupMenu );
        if ( autoAssigningMnemonics ) {
          assignMnemonics( popupMenu );
        final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        final Point result = new Point(mouseClickPoint);
        SwingUtilities.convertPointToScreen( result, c);
        Dimension popupSize = popupMenu.getPreferredSize();
        popupSize.height = popupSize.height + 30; // as Windows TaskBar is overlapping always
          if ( popupSize != null ) {
          if ( result.getX() + popupSize.getWidth() > screenSize.getWidth() ) {
            result.setLocation( screenSize.getWidth() - popupSize.getWidth() , result.getY() );
          if ( result.getY() + popupSize.getHeight() > screenSize.getHeight() ) {
            result.setLocation( result.getX(), screenSize.getHeight() - popupSize.getHeight() );
        result.x = Math.max( 0, result.x );
        result.y = Math.max( 0, result.y );
        SwingUtilities.convertPointFromScreen( result, c );
        javax.swing.SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
                popupMenu.show( c, (int) result.getX(), (int) result.getY());
    Please let me know your feedback. Need to confirm whether this issue is really exists or not.

  • A context menu does not appear when I type the annotations

    I want to change the size and color of the pen, but can not get the context menu.

    Hi,
    Could you please try following steps and let me know if this helps.
    1) Open you pdf.
    2) Tap on pdf to bring the top bar.
    3) Tap on Comment icon.
    4) Choose pen.
    5) Draw the annotation with your pen
    6) Press Save
    7) Tap on your annotation.
    Here you will get the context menu that will allow you to change Thickness,color and opacity of your annotation.
    -mayank

  • Quick menu does not recognize my Canon scanner

    I've been using my Canon 9000F scanner for a couple of months. Added an iX6520 printer today and installed all the software. The Quick Menu no longer recognizes the scanner. How do I trouble shoot this? Thanks.
    System: Windows 7 x64

    Hello Mike9685,
    Please try disconnecting the scanner and connecting it back into the computer again.  Be sure it is connected via USB cable directly to the computer instead of going through a USB hub or the like.  If the issue persists, please try scanning with the MP Navigator software the scanner came bundled with, to help test the issue.  If all else fails, please reply with the specific error or message that occurs when you attempt to scan.
    If this is a time-sensitive matter, additional support options are available at Contact Us.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • Canon quick menu software does not recognize scanner for MG5520

    Hi,
    I have Canon Wireless Inkjet Photo All-In-One printer (MG5520).  I have installed Canon complete software.  But the quick menu does not recognize my scanner.  In Preferences only Printer is listed, but for Scanner nothing is available.  Could you please suggest how to get scanner as well for my device?
    My OS is Windows 7.
    Regards,
    Sharath.

    Hi sharma_swp,
    Reinstalling the drivers for the printer from the Canon USA website should provide the scanning option on the Quick Menu. Please click here to go to the Drivers and Software page for the PIXMA MG5520.  Once on the initial download page for your model, please do the following:
    1. Verify that the operating system detected in the "OPERATING SYSTEM" drop-down menu is correct, and if it is not, please click the drop-down menu to select your operating system.
    2. Next, please click on the red arrow next to the "RECOMMENDED DOWNLOADS" section and click the FULL DRIVER AND SOFTWARE PACKAGE file. When you do, a red DOWNLOAD button will appear. Please click on the checkbox below the DOWNLOAD button, then click the red DOWNLOAD button to begin the download. The time for the download process may vary depending on the speed of your Internet connection and the size of the file being downloaded.
    Once the file has been downloaded, please double-click on it to reinstall the drivers and software on your computer, then restart your computer.  If you still have difficulty with the Quick Menu showing items related to scanning, please call or email us using one of the methods on the Contact Us page for further assistance.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • Reader 11 does not recognize the default MAPI application Outlook 2013

    I am having repeatable issues with Reader not being ablet to pop open an email from the Send File command in the File Menu.
    All of the other applications such as QuickBooks and Word seem to open an email window and prepopulate it with the attachment as expected.
    Here is the screen cap:
    Note that Outlook is open and that it still does not recognize.
    I can get the webmail interface to work with the Office2013/Office365 combo, but it only dumps a blank email with the attachment in your Drafts folder.
    This problem has been shown to exist on both 32 and 64 bit versions of Windows 7 and both 32 and 64 bit versions of Outlook 2013.
    This is a growing issue amongst my Office365 client base, which is a growing client base. Any help would be considered a blessing!

    Ok sorry I've taken so long to respond.  The reply button wouldn't pop up for me to reply!
    There was never a dialog box asking for me to select the program from installed programs when I open the pdf from outlook express.  But when I opened a pdf from my desktop it asked that question and I had it "always use this program to open this type of file." So I assumed that it was would work when opening from outlook express.  But it doesn't.
    I've tried unclicking the protected mode button under the preferences general section.  And finally I'm not sure how to post screenshots of the attachment thumbnail and dialog.  I'm looking all over my keyboard for a button to push I don't have a clue as to what to do!  I do have a print Scr button but when I click on it nothing happens.  I've tried holding down the shift key and the button and the alt key and print scr button but nothing happens.
    Could it be that somehow it's not recognizing ARCO.EXCH.DOCUMENT as that's what it thinks the type of document is?
    I've already created an association for pdf files and it'll open them on my desktop, just not in outlook express.

  • Nokia 5800 Does not recognize Outlook 2007

    My cel is Nokia 5800 Express Music. Until yesterday my agenda and messages at Microsoft Outlook 2007 synchronized correctly using PC Suite 2.2.0.241. A message in PC Suite appeared suggesting to upgrade to version 2.2.1.23. After upgrading PC Suite does not recognizes Microsoft Outlook 2007 and I cannot synchronize again. I uninstalled version 2.2.1.23 and reinstalled version 2.2.o.241 but it does not work as it request to upgrade to the last version. Please, help me what to do as this feature is of greatest importance for me.
    Thank You.
    Celso.

    In addition to the previous message asking help, I am using Windows 7 and the connection of the cellular to the PC is through the Nokia cable I received with the phone.

  • LC ES4 form in Adobe Reader DC: "MS Office Outlook does not recognize ","...*

    I have a form created in Adobe Live Cycle Designer ES4 with extended rights leveraged in Acrobat Pro 11. The form uses an array to store a number of e-mail addresses. When a user selects a name in another field the e-mail address is ‘subtracted’ from the array and the e-mail is created so that it is sent ‘To’ that individual and cc’d to the remainder of the e-mail addresses in the array. The array format is var ListAddr = new Array("[email protected]", "[email protected]", [email protected])
    The whole thing works very well so long as Adobe Reader 11 is used: e-mail addresses appear in Outlook with a semi-colon between the addresses. The e-mail clients used by those completing the form are either Outlook 2007 or Outlook 2010.
    Eventually users will migrate to Adobe Reader DC so I have been testing the form in Reader DC in advance and am met with the message:
    “Microsoft Office Outlook does not recognize “,”…”
    A Google search revealed that this issue can be rectified by going to Outlook Tools -> Options -> Preferences -> E-mail options -> Advanced e-mail options and checking the box for “Allow comma as address separator”. Unfortunately doing this makes no difference. The message still appears.
    This tends to point the finger at Acrobat Reader DC. Has something changed in how Reader DC handles JavaScript? Do I need Acrobat DC rather than Acrobat Pro 11 to keep my form working? Has anyone any ideas why this might happen?

    The problem only appears in versions newer than 9. It should definately be something that you could configure your way out of in the trust center, but I have tried "everything" and I am afraid it is not possible.
    Anybody who has a solution for this?

Maybe you are looking for

  • How do I add more HDs to my Acer ATC-120-UC22?

    Mounting holes for additional HD is not compatible with SATA HD, what to do?

  • Install oracle 8.1.7 problems

    I am trying to install oracle 8.1.7 downloaded from the OTN, i am unable. I have windows 2000 advance server as OS and my machine has a p4 processor. But I am able to load oracle 8.1.5 after loading 815, i tried to install Oracle designer 6i and agai

  • IDOC to EDI file scenario and EDI file to IDOC scenario without Seeburger

    Hi All, IDOC (Invoice) to EDI file scenario without Seeburger Pls let me know if anybody have blogs for the same EDI file to IDOC (Orders) scenario without Seeburger Pls let me know if anybody have blogs for the same Regards

  • How do you create blurred edges in CS5?

    Hi there! How do you create blurred edges on a photo or a shape in Photoshop CS5? Thanks! .

  • Opening File in Illustrator CC

    I just started using the CC version of the design products this weekend, and yesterday I spent all day working on a design in Illustrator. Today if I try to open it, Illlustrator just hangs - and eventually I have to force quit. I get no error messag