简体   繁体   中英

How to add a menu item into a File Type in Outlook

I'm trying to create a Export method of a VCF file to our CRM application.

I'm running the new VS 2010 but target the project as .NET 3.5

what is the technique to hook up into this context menu ?

alt text http://www.balexandre.com/temp/2010-04-14_1523.png

I'm very new to AddIns but as a logical line of thought is to create an Outlook AddIn, but I'm failing miserably to add a menu item to this context menu :(

Thank you for any help on this

Got it

alt text http://www.balexandre.com/temp/2010-04-14_1604.png

this.Application.AttachmentContextMenuDisplay += 
    new Outlook.ApplicationEvents_11_AttachmentContextMenuDisplayEventHandler(ThisAddIn_AttachmentContextMenuDisplay);

and then in the eventHandler

private void ThisAddIn_AttachmentContextMenuDisplay(Office.CommandBar commandBar, Outlook.AttachmentSelection attachments)
{
    if (attachments.Count > 0)
    {
        Office.CommandBarControl cbc = commandBar.Controls.Add(
                  Office.MsoControlType.msoControlButton, 
                  missing, missing, missing, true);

        cbc.Caption = "Export into SuperOffice";
        cbc.OnAction = "Action";
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM