Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2007

Tip: Looking for answers? Try searching our database.

Floating menu bar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
IanB - 04 Aug 2007 22:18 GMT
Not really a form issue but this is the closest forum I can see.
I need to set up a floating menu bar (Word 2000>) which shows the entries
vertically down the menu bar as it does with a standard menu bar.
With all my attempts, the menubar positions the entries horizontally and
after hours of research I still can't get the items displayed vertically.

Before I abandon this and move to a form, can someone please tell me how to
achieve this with a menu bar.

TIA

Ian B
Shauna Kelly - 05 Aug 2007 00:21 GMT
Hi Ian

It's not possible to do what you want.

A menu bar (toolbar, command bar -- they're all the same thing) can be
docked or floating.

If it's docked at the top or bottom of the screen, or if it's floating, the
text on the bar is horizontal. If it's docked at the left or right, the text
is vertical. You can't mix'n'match.

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> Not really a form issue but this is the closest forum I can see.
> I need to set up a floating menu bar (Word 2000>) which shows the entries
[quoted text clipped - 8 lines]
>
> Ian B
Jonathan West - 06 Aug 2007 08:22 GMT
> Hi Ian
>
[quoted text clipped - 6 lines]
> the text on the bar is horizontal. If it's docked at the left or right,
> the text is vertical. You can't mix'n'match.

Actually, you can get a button or menu to have a horizontal caption while in
a toolbar that is docked to the right or left. You have to set the button
Style to msoButtonIconAndWrapCaption, msoButtonIconAndWrapCaptionBelow or
msoButtonWrapCaption. If you want to force the whole caption to appear on a
single line, ensure that any spaces in the caption are replaced with
nonbreaking spaces.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

Shauna Kelly - 06 Aug 2007 09:58 GMT
Hi Jonathan

Yes, of course you're right. And indeed, I've done that in the past.

But it's not possible to do the other way round, is it? That is, the OP
wanted vertical text on a floating toolbar.

Shauna

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

>> Hi Ian
>>
[quoted text clipped - 13 lines]
> force the whole caption to appear on a single line, ensure that any spaces
> in the caption are replaced with nonbreaking spaces.
Jonathan West - 06 Aug 2007 11:42 GMT
> Hi Jonathan
>
> Yes, of course you're right. And indeed, I've done that in the past.
>
> But it's not possible to do the other way round, is it? That is, the OP
> wanted vertical text on a floating toolbar.

I think we may have a slightly different understanding of what Ian wants -
hopefully he can come and clarify. I understood that he wanted the buttons
arranged vertically, not that the text was oriented vertically. And in a
floating toolbar, this is not a great problem, all you need do (as he has
himself discovered) is to set the Height and Width properties of the
floating toolbar to appropriate values

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

Ian Bayly - 08 Aug 2007 23:11 GMT
Thank you all for your comments & suggestions.

Yes, I was after horizontal text, with entries vertical. Imagine the Word
"Tools" menu floating, that was the effect I wanted.
The floating menu bar is a much better looking object than a look-alike form
with buttons, and is considerably smaller, so I am going to persevere with
the menu.

Could I ask a further question please.
I have 23 entries on the menu with shortcuts thus:
&A   Entry xxx
&B   Entry yyy
&C   Entry eee
etc.
Because the menu shares focus with the active document and whatever menus
are showing, my shortcut keys lose priority to the standard menu shortcuts.
i.e. &F will activate the "File" menu rather than the duplicate floating
menu shortcut.  I am looking at a work around which temporarily hides all
standard menu bars and strips the basic bar as much as I dare, just while
the floating menu is operative, then restoring all menu settings when
floating bar is hidden.
Quite a clumsy task.

To my question: As stated, the main toolbar appears to have shortcut
precedence over my menu bar. What controls this and can I set my floating
toolbar shortcuts to take precedence over the standard menu shortcuts?  i.e.
I want my &F to function rather than the "File" menu.
A big ask perhaps!

TIA

Ian B

>> Hi Jonathan
>>
[quoted text clipped - 9 lines]
> himself discovered) is to set the Height and Width properties of the
> floating toolbar to appropriate values
Jonathan West - 09 Aug 2007 12:33 GMT
> Thank you all for your comments & suggestions.
>
[quoted text clipped - 25 lines]
> i.e. I want my &F to function rather than the "File" menu.
> A big ask perhaps!

If you press Alt, then F twice, your menu will be highlighted (the first F
will highlight the File menu). If you have many menu items with the same
accelerator key, pressing the key repeatedly will cycle between them. If
that is good enough for you, there is no need for any further alteration.
But if you really want to temporarily hide the menu bar, change the Visible
property of Commandbars.ActiveMenuBar.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

Jean-Guy Marcil - 05 Aug 2007 02:07 GMT
IanB was telling us:
IanB nous racontait que :

> Not really a form issue but this is the closest forum I can see.
> I need to set up a floating menu bar (Word 2000>) which shows the
[quoted text clipped - 4 lines]
> Before I abandon this and move to a form, can someone please tell me
> how to achieve this with a menu bar.

What type of menu bar (graphic elements or textual ones)?
How are you building it (manually or with VBA)?
What is the purpose of the menu bar?

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

IanB - 05 Aug 2007 02:43 GMT
Thank you for you interest Jean-Guy.

Menu entries are .Style = msoButtonIconAndCaption
Building with VBA (Code snip below)
Menu will be used to carry out specialised formatting of text in uderlying
document (up to 36 options)
Since my first post I discover that manually altering the height of Menubar
(drag with mouse) will  produce a verticle menu, but how do I do this
programatically?
TIA

Code Snip
~~~~~~~~~~~~~~~~
CustomizationContext = ActiveDocument.AttachedTemplate

Set MyBar = CommandBars.Add(Name:="Custom", Position:=msoBarFloating, _
MenuBar:=False, Temporary:=True)
'            MyBar.Height = 8000
With MyBar.Controls
   Set myButton = .Add(Type:=msoControlButton)
   myButton.Caption = "&A   Click Me"
   myButton.OnAction = "TestMacro"
   myButton.Style = msoButtonIconAndCaption
   myButton.Height = 15
   myButton.Width = 150

   Set myButton = .Add(Type:=msoControlButton)
   myButton.Style = msoButtonIconAndCaption
   myButton.Height = 15
   myButton.Width = 150
   myButton.Caption = "&B   Run Test Macro1"
   myButton.OnAction = "TestClick1"
   myButton.BeginGroup = True

   Set myButton = .Add(Type:=msoControlButton)
   myButton.Style = msoButtonIconAndCaption
   myButton.Height = 30
   myButton.Width = 150
   myButton.Caption = "&C   Run Test Macro2"
   myButton.OnAction = "TestClick2"

   Set myButton = .Add(Type:=msoControlButton)
   'myButton.FaceId = 201
   myButton.Style = msoButtonIconAndCaption
   myButton.Height = 30
   myButton.Width = 150
   myButton.Caption = "&D   Run Test Macro3"
   myButton.OnAction = "TestClick3"
~~~~~~~~~~~~~~~~

> IanB was telling us:
> IanB nous racontait que :
[quoted text clipped - 11 lines]
> How are you building it (manually or with VBA)?
> What is the purpose of the menu bar?
IanB - 05 Aug 2007 03:42 GMT
Got it sorted.
The command bar height can't be set at menu creation time but can be set
after menu is constructed.

i.e at the end of code:
myBar.visible=true
myBar.height=5000
Will tile bar vertically.

At creation button time you may need to set width= widest caption size for
all buttons to avoid getting two on the 1 line.

Ian B

> Thank you for you interest Jean-Guy.
>
[quoted text clipped - 62 lines]
>> How are you building it (manually or with VBA)?
>> What is the purpose of the menu bar?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.