Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Shortcut menus in 2007

Using Office 2007 and Win XP;

In XL 2007 shortcut menus (right click menus) is it possible to have a
"Title" row that does nothing when clicked but can be used to group the
custom commands?

For example (hopefully this will show up correctly in the news reader),

Formats <<<title/group
Number
Text
Imports <<<title/group
G/L
Payroll

If this is possible, what is the command to create a "Title" or "Group Name"
line?

Thanks much in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Shortcut menus in 2007

Something like this maybe

Sub AddToCellDropDown()
Dim CellDropDown As CommandBar
Dim MyDropDownItem As CommandBarControl

Call RemoveFromCellDropDown

Set CellDropDown = Application.CommandBars("Cell")
With CellDropDown.Controls.Add(Type:=msoControlPopup, befo=1)
.Caption = "My menu"
.Tag = "MyDropDownItem"

With .Controls.Add(Type:=msoControlButton)
.Caption = "Copy to new worksheet"
.OnAction = "Copy_Worksheet"
End With
With .Controls.Add(Type:=msoControlButton)
.Caption = "Copy to new workbook"
.OnAction = "Copy_Workbook"
End With
End With
End Sub

Sub RemoveFromCellDropDown()
Dim MyDropDownItem As CommandBarControl
Set MyDropDownItem = Application.CommandBars.FindControl(Tag:="MyDropDo wnItem")
If Not MyDropDownItem Is Nothing Then
MyDropDownItem.Delete
End If
Set MyDropDownItem = Nothing
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"XP" wrote in message ...
Using Office 2007 and Win XP;

In XL 2007 shortcut menus (right click menus) is it possible to have a
"Title" row that does nothing when clicked but can be used to group the
custom commands?

For example (hopefully this will show up correctly in the news reader),

Formats <<<title/group
Number
Text
Imports <<<title/group
G/L
Payroll

If this is possible, what is the command to create a "Title" or "Group Name"
line?

Thanks much in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Shortcut menus in 2007


Hi Ron,

Yeah; okay. I had not thought of using a menu control; that works!

Thanks!

"Ron de Bruin" wrote:

Something like this maybe

Sub AddToCellDropDown()
Dim CellDropDown As CommandBar
Dim MyDropDownItem As CommandBarControl

Call RemoveFromCellDropDown

Set CellDropDown = Application.CommandBars("Cell")
With CellDropDown.Controls.Add(Type:=msoControlPopup, befo=1)
.Caption = "My menu"
.Tag = "MyDropDownItem"

With .Controls.Add(Type:=msoControlButton)
.Caption = "Copy to new worksheet"
.OnAction = "Copy_Worksheet"
End With
With .Controls.Add(Type:=msoControlButton)
.Caption = "Copy to new workbook"
.OnAction = "Copy_Workbook"
End With
End With
End Sub

Sub RemoveFromCellDropDown()
Dim MyDropDownItem As CommandBarControl
Set MyDropDownItem = Application.CommandBars.FindControl(Tag:="MyDropDo wnItem")
If Not MyDropDownItem Is Nothing Then
MyDropDownItem.Delete
End If
Set MyDropDownItem = Nothing
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"XP" wrote in message ...
Using Office 2007 and Win XP;

In XL 2007 shortcut menus (right click menus) is it possible to have a
"Title" row that does nothing when clicked but can be used to group the
custom commands?

For example (hopefully this will show up correctly in the news reader),

Formats <<<title/group
Number
Text
Imports <<<title/group
G/L
Payroll

If this is possible, what is the command to create a "Title" or "Group Name"
line?

Thanks much in advance.


Reply
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
Sub-menus of main menus for Excel 2007 Eleanor Peppard New Users to Excel 1 March 16th 10 04:12 PM
Disable all shortcut menus in Office 2007? XP Excel Programming 4 October 27th 08 06:53 PM
Submenus on Shortcut Menus ZipCurs Excel Programming 2 March 4th 08 09:12 PM
Disable Shortcut Menus / Alt-F8 Peter Rooney Excel Programming 2 August 12th 05 02:17 PM


All times are GMT +1. The time now is 07:51 PM.

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

About Us

"It's about Microsoft Excel"