Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default How to figure out which right-click context menu is appearing whenclicking shape/picture

I have recently converted to 2007 from 2003 and have a problem with
accessing the commands on the right click menu for a grouped shape.
This code used to work but now it appears as though another menu is
appearing and I don't believe that "pictures context menu" is it
either. So the question is how to determine the name of the menu I
see?

Application.CommandBars("Shapes").Reset

Dim CB As CommandBar
Dim Ctrl As CommandBarControl

Set CB = .CommandBars("Shapes")

For Each Ctrl In CB.Controls
Ctrl.Delete
Next
Set Ctrl = CB.Controls.Add(Type:=msoControlButton)
With Ctrl
.Caption = "Insert Picture"
.OnAction = "CompInsert"
.FaceId = 295
End With
Set Ctrl = CB.Controls.Add(Type:=msoControlButton)
With Ctrl
.Caption = "Delete Picture"
.OnAction = "CompDelete"
.FaceId = 292
End With
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default How to figure out which right-click context menu is appearing when clicking shape/picture

i think popup menus in excel 07 not same as before. you see their font color
is blu but if you make old popup show like by CommandBars("cell").ShowPopup
you see font is black. i think MS change something here and maybe users can
no more change popup menus.

Also if you list all popups and there controls you dont see any that match
new menus

Sub ListPopups()
Dim CB As CommandBar
Dim Ctrl As CommandBarControl
Dim RowCounter As Integer
Dim ColCounter As Integer
For Each CB In CommandBars
If CB.Type = msoBarTypePopup Then
RowCounter = RowCounter + 1
Cells(RowCounter, 1).Value = CB.Name
ColCounter = 1
For Each Ctrl In CB.Controls
ColCounter = ColCounter + 1
Cells(RowCounter, ColCounter).Value = Ctrl.Caption
Next
End If
Next
End Sub



wrote in message
...
|I have recently converted to 2007 from 2003 and have a problem with
| accessing the commands on the right click menu for a grouped shape.
| This code used to work but now it appears as though another menu is
| appearing and I don't believe that "pictures context menu" is it
| either. So the question is how to determine the name of the menu I
| see?
|
| Application.CommandBars("Shapes").Reset
|
| Dim CB As CommandBar
| Dim Ctrl As CommandBarControl
|
| Set CB = .CommandBars("Shapes")
|
| For Each Ctrl In CB.Controls
| Ctrl.Delete
| Next
| Set Ctrl = CB.Controls.Add(Type:=msoControlButton)
| With Ctrl
| .Caption = "Insert Picture"
| .OnAction = "CompInsert"
| .FaceId = 295
| End With
| Set Ctrl = CB.Controls.Add(Type:=msoControlButton)
| With Ctrl
| .Caption = "Delete Picture"
| .OnAction = "CompDelete"
| .FaceId = 292
| End With

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default How to figure out which right-click context menu is appearingwhen clicking shape/picture

If that is the case then is there a way to deactivate the right click
menu for shapes/pictures. I can get it to work on the cells on the
sheet by setting cancel=true in the beforerightclick procedure for the
worksheet but it does not have any affect on the shapes/pictures on
the sheet.

On Jun 11, 5:04*am, "Homey" <none wrote:
i think popup menus in excel 07 not same as before. you see their font color
is blu but if you make old popup show like by CommandBars("cell").ShowPopup
you see font is black. i think MS change something here and maybe users can
no more change popup menus.

Also if you list all popups and there controls you dont see any that match
new menus

Sub ListPopups()
* * Dim CB As CommandBar
* * Dim Ctrl As CommandBarControl
* * Dim RowCounter As Integer
* * Dim ColCounter As Integer
* * For Each CB In CommandBars
* * * * If CB.Type = msoBarTypePopup Then
* * * * * * RowCounter = RowCounter + 1
* * * * * * Cells(RowCounter, 1).Value = CB.Name
* * * * * * ColCounter = 1
* * * * * * For Each Ctrl In CB.Controls
* * * * * * * * ColCounter = ColCounter + 1
* * * * * * * * Cells(RowCounter, ColCounter).Value = Ctrl.Caption
* * * * * * Next
* * * * End If
* * Next
End Sub

wrote in message

...
|I have recently converted to 2007 from 2003 and have a problem with
| accessing the commands on the right click menu for a grouped shape.
| This code used to work but now it appears as though another menu is
| appearing and I don't believe that "pictures context menu" is it
| either. So the question is how to determine the name of the menu I
| see?
|
| Application.CommandBars("Shapes").Reset
|
| Dim CB As CommandBar
| Dim Ctrl As CommandBarControl
|
| Set CB = .CommandBars("Shapes")
|
| For Each Ctrl In CB.Controls
| * *Ctrl.Delete
| Next
| Set Ctrl = CB.Controls.Add(Type:=msoControlButton)
| With Ctrl
| * *.Caption = "Insert Picture"
| * *.OnAction = "CompInsert"
| * *.FaceId = 295
| End With
| Set Ctrl = CB.Controls.Add(Type:=msoControlButton)
| With Ctrl
| * *.Caption = "Delete Picture"
| * *.OnAction = "CompDelete"
| * *.FaceId = 292
| End With


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
Screwed Up my Right Click Context Menu, Please Help cpmame Excel Programming 11 March 12th 09 10:59 PM
Undo button in the context menu (right click menu) Madiya Excel Programming 7 April 7th 08 04:33 PM
Custom Context menu (Right click menu) not working in sheet changeevent. Madiya Excel Programming 3 February 11th 08 01:24 PM
Right click Drag and Drop context menu Al_Raiani Excel Programming 0 June 28th 07 07:46 PM
Right-Click (Context Menu) Kryptonix Excel Programming 6 October 25th 05 03:59 PM


All times are GMT +1. The time now is 03:20 PM.

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"