PC Review


Reply
Thread Tools Rate Thread

Custom commandbar, submenu questions

 
 
=?Utf-8?B?RGFsZSBGeWU=?=
Guest
Posts: n/a
 
      24th Oct 2007
1. When I added the code below to a test menu, the triangle that pops up
next to "Error" (to indicate a submenu) in the main menu shows up on the line
below the text rather than on the same line as the text. I'm sure there is
something simple that I am missing. Any ideas

2. In the sub Check_Errors, I want to enable the "Review Errors" menu item,
but cannot figure out the correct syntax to enable a submenus control.

Set CmdBarSub = CmdBar.Controls.Add(Type:=msoControlPopup)
With ctrl
.Caption = "Error"
End With

Set ctrl = CmdBarSub.Controls.Add(Type:=msoControlButton)
With ctrl
.Caption = "Check Errors"
.OnAction = "Check_Errors"
End With
Set ctrl = CmdBarSub.Controls.Add(Type:=msoControlButton)
With ctrl
.Caption = "Review Errors"
.OnAction = "Review_Errors"
.Enabled = False
End With

--
Don''t forget to rate the post if it was helpful!

Email address is not valid.
Please reply to newsgroup only.
 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      24th Oct 2007
I do not see the first problem.

Re enabling the control later. If you assign a Tag to the control you use
it later:

Assign Tag property:

With ctrl
.Caption = "Review Errors"
.OnAction = "Review_Errors"
.Enabled = False
.Tag = "RevErrors"
End With

and later:

CommandBars.FindControl(Tag:="RevErrors").Enabled = True

--
Jim
"Dale Fye" <(E-Mail Removed)> wrote in message
news:F52017B3-6FF6-4296-A32C-(E-Mail Removed)...
| 1. When I added the code below to a test menu, the triangle that pops up
| next to "Error" (to indicate a submenu) in the main menu shows up on the
line
| below the text rather than on the same line as the text. I'm sure there
is
| something simple that I am missing. Any ideas
|
| 2. In the sub Check_Errors, I want to enable the "Review Errors" menu
item,
| but cannot figure out the correct syntax to enable a submenus control.
|
| Set CmdBarSub = CmdBar.Controls.Add(Type:=msoControlPopup)
| With ctrl
| .Caption = "Error"
| End With
|
| Set ctrl = CmdBarSub.Controls.Add(Type:=msoControlButton)
| With ctrl
| .Caption = "Check Errors"
| .OnAction = "Check_Errors"
| End With
| Set ctrl = CmdBarSub.Controls.Add(Type:=msoControlButton)
| With ctrl
| .Caption = "Review Errors"
| .OnAction = "Review_Errors"
| .Enabled = False
| End With
|
| --
| Don''t forget to rate the post if it was helpful!
|
| Email address is not valid.
| Please reply to newsgroup only.


 
Reply With Quote
 
=?Utf-8?B?RGFsZSBGeWU=?=
Guest
Posts: n/a
 
      24th Oct 2007
Worked like a charm. Thanks.
--
Don''t forget to rate the post if it was helpful!

Email address is not valid.
Please reply to newsgroup only.


"Jim Rech" wrote:

> I do not see the first problem.
>
> Re enabling the control later. If you assign a Tag to the control you use
> it later:
>
> Assign Tag property:
>
> With ctrl
> .Caption = "Review Errors"
> .OnAction = "Review_Errors"
> .Enabled = False
> .Tag = "RevErrors"
> End With
>
> and later:
>
> CommandBars.FindControl(Tag:="RevErrors").Enabled = True
>
> --
> Jim
> "Dale Fye" <(E-Mail Removed)> wrote in message
> news:F52017B3-6FF6-4296-A32C-(E-Mail Removed)...
> | 1. When I added the code below to a test menu, the triangle that pops up
> | next to "Error" (to indicate a submenu) in the main menu shows up on the
> line
> | below the text rather than on the same line as the text. I'm sure there
> is
> | something simple that I am missing. Any ideas
> |
> | 2. In the sub Check_Errors, I want to enable the "Review Errors" menu
> item,
> | but cannot figure out the correct syntax to enable a submenus control.
> |
> | Set CmdBarSub = CmdBar.Controls.Add(Type:=msoControlPopup)
> | With ctrl
> | .Caption = "Error"
> | End With
> |
> | Set ctrl = CmdBarSub.Controls.Add(Type:=msoControlButton)
> | With ctrl
> | .Caption = "Check Errors"
> | .OnAction = "Check_Errors"
> | End With
> | Set ctrl = CmdBarSub.Controls.Add(Type:=msoControlButton)
> | With ctrl
> | .Caption = "Review Errors"
> | .OnAction = "Review_Errors"
> | .Enabled = False
> | End With
> |
> | --
> | Don''t forget to rate the post if it was helpful!
> |
> | Email address is not valid.
> | Please reply to newsgroup only.
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom CommandBar bobparker122 Microsoft Word Document Management 0 15th Jan 2008 04:01 PM
commandbar submenu VBA syntax Toxalot Microsoft Access 2 27th Aug 2007 11:38 AM
Custom Menu's Submenu problem =?Utf-8?B?SXJzaGFkIEFsYW0=?= Microsoft Access 0 22nd Jun 2006 12:38 PM
custom commandbar questions ckoch Microsoft Excel Programming 1 12th Feb 2006 08:53 AM
Add submenu to custom menu Excel Microsoft Excel Programming 1 23rd Jul 2003 08:07 AM


Features
 

Advertising
 

Newsgroups
 


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