LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to pimp my custom menu (want to display FaceIds and shortcuts combo)?


I've got the following code for a custom menu and it's working fine BU
how can I add FaceIds to the menu items? Is it also possible to sho
the custom shortcuts like they are showed in the default menu's (e.g
Ctrl+S for _S_ave in menu _F_ile?



PHP code
-------------------
'
' Macro found @ www.romanpress.com/Articles/Menus_R/Menus.htm
' Made some minor adjustments only
'
Private Sub AddMenu()
Dim cbpop As CommandBarControl
Dim cbctl As CommandBarControl
Dim cbsub As CommandBarControl
Dim cbpos As Integer

On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("Custom Menu").Delete
On Error GoTo 0

' Create a popup control on the main menu bar
cbpos = Application.CommandBars("Worksheet Menu Bar").Controls("Help").Index

Set cbpop = Application.CommandBars("Worksheet Menu Bar"). _
Controls.Add(Type:=msoControlPopup, Befo=cbpos)
cbpop.Caption = mname
cbpop.Visible = True

' Add menu item
Set cbctl = cbpop.Controls.Add(Type:=msoControlButton)
cbctl.Visible = True
cbctl.Style = msoButtonCaption
cbctl.Caption = "&Update rapport"
cbctl.OnAction = "UpdateRapport"

' Add menu item
Set cbctl = cbpop.Controls.Add(Type:=msoControlButton)
cbctl.Visible = True
cbctl.Style = msoButtonCaption
cbctl.Caption = "&Print all sheets"
cbctl.OnAction = "PrintAllSheets"

' Add a popup for a submenu
Set cbsub = cbpop.Controls.Add(Type:=msoControlPopup)
cbsub.Visible = True
cbsub.Caption = "Rapport op&slaan als..."
' Add submenu item
Set cbctl = cbsub.Controls.Add(Type:=msoControlButton)
cbctl.Visible = True
cbctl.Style = msoButtonCaption
cbctl.Caption = "Save As (Preformatted)"
cbctl.OnAction = "SaveAs"
' Add submenu item
Set cbctl = cbsub.Controls.Add(Type:=msoControlButton)
cbctl.Visible = True
cbctl.Style = msoButtonCaption
cbctl.Caption = "Save Copy As (Preformatted)"
cbctl.OnAction = "SaveCopyAs"
End Su
-------------------

--
s80N

-----------------------------------------------------------------------
s80NL's Profile: http://www.excelforum.com/member.php...fo&userid=3637
View this thread: http://www.excelforum.com/showthread.php?threadid=56178

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Display of Keyboard Shortcuts in MenuBar and/or Ribbon Ray in Jacksonville Setting up and Configuration of Excel 0 October 29th 09 06:21 PM
formatting combo box on custom menu [email protected] Excel Programming 0 November 10th 05 10:29 PM
menu bar keyboard shortcuts intermittent. windsurferLA Excel Programming 2 May 25th 05 07:53 AM
How do I display all assigned keyboard shortcuts? Musawwir Spiegel New Users to Excel 8 April 19th 05 03:31 AM
FaceIDs for VBE Menus MWE[_9_] Excel Programming 1 January 23rd 04 08:46 AM


All times are GMT +1. The time now is 09:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"