Hi Peter,
Here a sample code about customize menu.
private void button1_Click(object sender, System.EventArgs e)
{
Excel.Application exApp = new Excel.ApplicationClass();// =
(Excel.Application)Marshal.GetActiveObject("Excel.Application");
object o = Missing.Value;
exApp.Visible=true;
Office.CommandBarPopup MenuObject=
(Office.CommandBarPopup)exApp.CommandBars[1].Controls.Add((object)10,o,o,(ob
ject)10,(object)true);
MenuObject.Caption="TestMenu";
Office.CommandBarButton mItem=
(Office.CommandBarButton)MenuObject.Controls.Add((object)1,o,o,o,o);
mItem.Caption="Test";
mItem.Click+=new
Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(mItem_Click)
;
}
private void mItem_Click(Microsoft.Office.Core.CommandBarButton Ctrl, ref
bool CancelDefault)
{
MessageBox.Show("hello");
}
You may take a look.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure!
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
X-Tomcat-ID: 173134736
References: <
[email protected]>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: (e-mail address removed) (Peter Huang [MSFT])
Organization: Microsoft
Date: Thu, 18 Sep 2003 06:16:21 GMT
Subject: RE: Novice: Custom Menu in Office?
X-Tomcat-NG: microsoft.public.office.developer.com.add_ins
Message-ID: <
[email protected]>
Newsgroups: microsoft.public.office.developer.com.add_ins
Lines: 49
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.office.developer.com.add_ins:4533
NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
Hi Peter,
Here are a few helpful links. You may take a look.
http://groups.google.com/groups?q=addin+office+"custom+menu"+sample&hl= z
h-CN&lr=&ie=UTF-8&oe=UTF-8&selm=%23eZP0if3AHA.1308%40tkmsftngp07&rnum=1
http://groups.google.com/groups?q=addin+office+"custom+menu"+sample&hl=
z
h-CN&lr=&ie=UTF-8&oe=UTF-8&selm=ud%23UqcTe%24GA.223%40cppssbbsa02.microsoft