Recreating Certain Functionality on Custom Menu Bars

B

Brian Smith

I'm creating some custom menu bars and, for the life of me, I cannot figure
out how to show the list of open objects as is done on the built-in Window
menu. Also, how does one recreate the Horizontal and Vertical Space menu
items that appear when designing forms and reports. I find it interesting
that they provide just about every other design option in the Customize
dialog but these ones. Are there VBA equivalents or some other method that
would allow one to recreate these menu items?

Thanks.

Brian
 
M

Marshall Barton

Brian said:
I'm creating some custom menu bars and, for the life of me, I cannot figure
out how to show the list of open objects as is done on the built-in Window
menu. Also, how does one recreate the Horizontal and Vertical Space menu
items that appear when designing forms and reports. I find it interesting
that they provide just about every other design option in the Customize
dialog but these ones. Are there VBA equivalents or some other method that
would allow one to recreate these menu items?


Once you're in customize mode, you can just drag the built
in iemt to your menu/tool bar.
 
B

Brian Smith

Marshall Barton said:
Once you're in customize mode, you can just drag the built
in iemt to your menu/tool bar.

Yes, I realize you can do that but, as I pointed out, they don't provide the
buttons for all existing items. I'm assuming this can be done via VBA but I
can't figure out what the commands would be for the items I trying to
recreate.

Brian
 
M

Marshall Barton

Brian said:
Yes, I realize you can do that but, as I pointed out, they don't provide the
buttons for all existing items. I'm assuming this can be done via VBA but I
can't figure out what the commands would be for the items I trying to
recreate.


I guess I don't understand the not providing all existing
buttons part. Generally the problem with using the built in
menu items is that you can not modify their details.

I suppose that you want to code up your own version of the
Windows item. I imagine that you can simulate that
reasonably well by looking at the Forms and Reports
collections or the AllForms, AllReports, etc. collections,
but adding the names to the menu will be a tedious exercise.
 
B

Brian Smith

Marshall Barton said:
I guess I don't understand the not providing all existing
buttons part. Generally the problem with using the built in
menu items is that you can not modify their details.

I suppose that you want to code up your own version of the
Windows item. I imagine that you can simulate that
reasonably well by looking at the Forms and Reports
collections or the AllForms, AllReports, etc. collections,
but adding the names to the menu will be a tedious exercise.

I'll try explaining this again. I'm creating some custom menu bars and would
like to have some of the same items appear on them as appear on the built-in
menu bars. For the most part this is rather simple, as you can just drag the
commands from the Customize toolbars dialog. However, not all of the items
that appear on the built-in menu bars appear in the Customize dialog. If the
ones I'm looking for do exist then I'd like to know where? Assuming that
they don't, it must be possible to achieve the same functionality through
VBA. That is what I'm asking about. If these are not the correct NGs for
this type of question please point in the right direction.

Thanks.

Brian
 
M

Marshall Barton

Brian said:
"Marshall Barton" wrote

I'll try explaining this again. I'm creating some custom menu bars and would
like to have some of the same items appear on them as appear on the built-in
menu bars. For the most part this is rather simple, as you can just drag the
commands from the Customize toolbars dialog. However, not all of the items
that appear on the built-in menu bars appear in the Customize dialog. If the
ones I'm looking for do exist then I'd like to know where? Assuming that
they don't, it must be possible to achieve the same functionality through
VBA. That is what I'm asking about. If these are not the correct NGs for
this type of question please point in the right direction.


I think this is as good a news group as any, but there may
be one specific to Office Toolbar stuff??

When I said you can drag an existing tool/menu bar item to
your custom bar, I meant dragging it from an existing
tool/menu bar, not from the Commands tab in the Customize
window.

To do what i was suggesting, first make sure your custom
menu bar and the tool/menu bar you want to copy from are
both visible (e.g. Form Design for the Format menu or the
Database for the Windows menu item). Then, right click in
the tool/menu bar area and select Customize in the popup
menu. At this point, you can go to the desired menu item
and drag it ***holding the control key down*** to ***copy***
the item to your menu bar.

I am sure you can also do all this using the various methods
of the CommandBar object so if that's what your trying to
do, check them in Help and see how far you can get.
Personally, I find that object model difficult to work with
and have managed to avoid it so far. You may want to look
at this article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnofftalk/html/office04042002.asp
or search the web for additional stuff.
 
B

Brian Smith

Marshall Barton said:
I think this is as good a news group as any, but there may
be one specific to Office Toolbar stuff??

When I said you can drag an existing tool/menu bar item to
your custom bar, I meant dragging it from an existing
tool/menu bar, not from the Commands tab in the Customize
window.

To do what i was suggesting, first make sure your custom
menu bar and the tool/menu bar you want to copy from are
both visible (e.g. Form Design for the Format menu or the
Database for the Windows menu item). Then, right click in
the tool/menu bar area and select Customize in the popup
menu. At this point, you can go to the desired menu item
and drag it ***holding the control key down*** to ***copy***
the item to your menu bar.

Marsh, the problem with this method is that if you turn off allow Built-In
Toolbars in the Startup dialog you "lose" certain toolbar items. I can't
tell if this is a bug or a feature but that is definitely what is happening.
If you have allow Built-In Toolbars checked you can create custom toolbars
and drag any item from a built-in toolbar and it will work.
I am sure you can also do all this using the various methods
of the CommandBar object so if that's what your trying to
do, check them in Help and see how far you can get.
Personally, I find that object model difficult to work with
and have managed to avoid it so far. You may want to look
at this article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnofftalk/html/office04042002.asp
or search the web for additional stuff.

I was able to recreate some of the functionality via VBA but not all. I'm
beginning to think that some of the menu items are relying on Windows for
their functionality. I agree with you that the Command Bars object model is
difficult to work with. I find it to be inconsistent with other object
models and incomplete compared to others as well. Oh well, I'll have to
suffer for now unless someone else has a greater understanding in this area.

Thanks for the link to the article. It looks interesting and useful.

Brian
 
M

Marshall Barton

Brian said:
Marsh, the problem with this method is that if you turn off allow Built-In
Toolbars in the Startup dialog you "lose" certain toolbar items. I can't
tell if this is a bug or a feature but that is definitely what is happening.
If you have allow Built-In Toolbars checked you can create custom toolbars
and drag any item from a built-in toolbar and it will work.


I was able to recreate some of the functionality via VBA but not all. I'm
beginning to think that some of the menu items are relying on Windows for
their functionality. I agree with you that the Command Bars object model is
difficult to work with. I find it to be inconsistent with other object
models and incomplete compared to others as well. Oh well, I'll have to
suffer for now unless someone else has a greater understanding in this area.

Thanks for the link to the article. It looks interesting and useful.


Ahhh, I guess it makes sense for the built-in items to be
unavailable when you disable the built-in toolbars. I've
never tried that combination because I just hide the
standard stuff using:
DoCmd.ShowToolbar "Menu Bar", acToolbarNo
so I can provide a back door to turn them back on when I
need them.
 
H

heying

Brian Smith said:
I'm creating some custom menu bars and, for the life of me, I cannot
figure
out how to show the list of open objects as is done on the built-in Window
menu. Also, how does one recreate the Horizontal and Vertical Space menu
items that appear when designing forms and reports. I find it interesting
that they provide just about every other design option in the Customize
dialog but these ones. Are there VBA equivalents or some other method that
would allow one to recreate these menu items?

Thanks.

Brian
 
À

À×Ⱥ

Brian Smith said:
I'm creating some custom menu bars and, for the life of me, I cannot
figure
out how to show the list of open objects as is done on the built-in Window
menu. Also, how does one recreate the Horizontal and Vertical Space menu
items that appear when designing forms and reports. I find it interesting
that they provide just about every other design option in the Customize
dialog but these ones. Are there VBA equivalents or some other method that
would allow one to recreate these menu items?

Thanks.

Brian

g
 
H

heying

Brian Smith said:
I'm creating some custom menu bars and, for the life of me, I cannot
figure
out how to show the list of open objects as is done on the built-in Window
menu. Also, how does one recreate the Horizontal and Vertical Space menu
items that appear when designing forms and reports. I find it interesting
that they provide just about every other design option in the Customize
dialog but these ones. Are there VBA equivalents or some other method that
would allow one to recreate these menu items?

Thanks.

Brian
 
P

penglinhui

Brian Smith said:
I'm creating some custom menu bars and, for the life of me, I cannot
figure
out how to show the list of open objects as is done on the built-in Window
menu. Also, how does one recreate the Horizontal and Vertical Space menu
items that appear when designing forms and reports. I find it interesting
that they provide just about every other design option in the Customize
dialog but these ones. Are there VBA equivalents or some other method that
would allow one to recreate these menu items?

Thanks.

Brian
 
R

Rick Brandt

For the formatting buttons you need to copy them from the "Format" sub-menu
rather than from the customize dialog (it is strange that they aren't shown
there).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top