Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Understanding Menu Items and Building Them

Hi

When building a sub-menu, how can I find out what the <Before variable
should be where there may be other Temporary menu items already in the sub
menu before this is created - if say I want to have the sub-menu appear just
before Paste Special (say), how can I know which number that should be - I
am looking for a technique here not just a number for that instance

Hope that makes sense (hopefully!)

Thanks

Tim



With Application.CommandBars("Edit").Controls.Add(tempo rary:=True,
Befo=9)
.Tag = "PasteBanklineStatement"
On Error Resume Next
.Caption = "Paste Bankline Statement"
.OnAction = ThisWorkbook.Name & "!Pasting_Statement"
On Error GoTo 0
End With


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Understanding Menu Items and Building Them

Tim,
You can use the Index number for the particular menu item...

Set objNew = .Controls("Paste &Special...")
If Not objNew is Nothing Then
lngIndex = objNew.Index
Else
lngIndex = .Controls.Count + 1
End If
Set objNew = .Controls.Add(Type:=msoControlButton, Befo=lngIndex)

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Tim Childs" wrote in message
...
Hi
When building a sub-menu, how can I find out what the <Before variable
should be where there may be other Temporary menu items already in the sub
menu before this is created - if say I want to have the sub-menu appear just
before Paste Special (say), how can I know which number that should be - I
am looking for a technique here not just a number for that instance
Hope that makes sense (hopefully!)
Thanks
Tim

With Application.CommandBars("Edit").Controls.Add(tempo rary:=True,
Befo=9)
.Tag = "PasteBanklineStatement"
On Error Resume Next
.Caption = "Paste Bankline Statement"
.OnAction = ThisWorkbook.Name & "!Pasting_Statement"
On Error GoTo 0
End With
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Understanding Menu Items and Building Them

Jim

many thanks for posting this - it looks to be just what I needed

Tim



"Jim Cone" wrote in message
...
Tim,
You can use the Index number for the particular menu item...

Set objNew = .Controls("Paste &Special...")
If Not objNew is Nothing Then
lngIndex = objNew.Index
Else
lngIndex = .Controls.Count + 1
End If
Set objNew = .Controls.Add(Type:=msoControlButton, Befo=lngIndex)

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Tim Childs" wrote in message
...
Hi
When building a sub-menu, how can I find out what the <Before variable
should be where there may be other Temporary menu items already in the sub
menu before this is created - if say I want to have the sub-menu appear

just
before Paste Special (say), how can I know which number that should be - I
am looking for a technique here not just a number for that instance
Hope that makes sense (hopefully!)
Thanks
Tim

With Application.CommandBars("Edit").Controls.Add(tempo rary:=True,
Befo=9)
.Tag = "PasteBanklineStatement"
On Error Resume Next
.Caption = "Paste Bankline Statement"
.OnAction = ThisWorkbook.Name & "!Pasting_Statement"
On Error GoTo 0
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
Menu items Pietro Excel Discussion (Misc queries) 2 March 1st 07 10:41 AM
Understanding Menu Item matelot Excel Programming 4 December 13th 05 09:55 PM
New menu items Daniel Bonallack Excel Programming 2 November 2nd 05 07:59 PM
Menu items added with menu item editor in older versions Michael Hoffmann Excel Discussion (Misc queries) 2 January 7th 05 01:40 PM
Sub Menu Items pauluk[_72_] Excel Programming 1 July 27th 04 12:23 PM


All times are GMT +1. The time now is 12:33 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"