How to provide custom functionality on click of "New"?

M

madhavi

Hi,

I am developing an outlook addin in c#
I need to take some custom action, when user clicks “New” button o
presses “CTRL + N” instead of displaying a new mail message. As there i
no onclcik event for commandbarpopup, I tried to add onAction propert
as follows. But when I run the addin in debug mode, I am gettin
exception as “Member Not Found …..”


How can I provide my own functionality on click of New (I am able t
achieve this, if user clicks on any item in the dropdown list of new a
they are commandbuttons and they have onclicj)
Office.CommandBarPopup cbc = (Office.CommandBarPopup)

this.Application.ActiveExplorer().CommandBars.FindControl
(Office.MsoControlType.msoControlPopup, 30037, missing
missing);

cbc.OnAction = "newMenu_Click";

public void newMenu_Click(Microsoft.Office.Core.CommandBarPopu
Ctrl, ref bool CancelDefault)
{
MessageBox.Show("new button clicked............");

}
Any help is very much appreciate
 
K

Ken Slovak - [MVP - Outlook]

There are no events for that, as you can see in the Object Browser. You can
handle clicks on the buttons but that's about it. What are you trying to do?
You can add your own buttons to the popup and you can repurpose existing
buttons, but you can't do what you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top