Floating menu bar


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> User Forms RSS
Next:  invisible text box in Word 2007  
Author Message
IanB
External


Since: Aug 05, 2007
Posts: 3



PostPosted: Sun Aug 05, 2007 2:17 am    Post subject: Floating menu bar
Archived from groups: microsoft>public>word>vba>userforms (more info?)

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
Back to top
Jean-Guy Marcil
External


Since: Nov 30, 2006
Posts: 68



PostPosted: Sun Aug 05, 2007 2:17 am    Post subject: Re: Floating menu bar [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
> 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.

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?

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE.TakeThisOut@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Back to top
IanB
External


Since: Aug 05, 2007
Posts: 3



PostPosted: Sun Aug 05, 2007 2:17 am    Post subject: Re: Floating menu bar [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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"
~~~~~~~~~~~~~~~~

"Jean-Guy Marcil" <DontEvenTry@NoSpam> wrote in message
news:et0Yn0v1HHA.484@TK2MSFTNGP06.phx.gbl...
> 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
>> 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.
>
> 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?
>
> --
>
> Salut!
> _______________________________________
> Jean-Guy Marcil - Word MVP
> jmarcilREMOVE RemoveThis @CAPSsympatico.caTHISTOO
> Word MVP site: http://www.word.mvps.org
>
Back to top
IanB
External


Since: Aug 05, 2007
Posts: 3



PostPosted: Sun Aug 05, 2007 2:17 am    Post subject: Re: Floating menu bar [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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




"IanB" <Ian@(TakeOut)docspro.co.nz> wrote in message
news:OIb9ZIw1HHA.3760@TK2MSFTNGP03.phx.gbl...
> 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"
> ~~~~~~~~~~~~~~~~
>
> "Jean-Guy Marcil" <DontEvenTry@NoSpam> wrote in message
> news:et0Yn0v1HHA.484@TK2MSFTNGP06.phx.gbl...
>> 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
>>> 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.
>>
>> 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?
>>
>> --
>>
>> Salut!
>> _______________________________________
>> Jean-Guy Marcil - Word MVP
>> jmarcilREMOVE.TakeThisOut@CAPSsympatico.caTHISTOO
>> Word MVP site: http://www.word.mvps.org
>>
>
>
Back to top
Shauna Kelly
External


Since: Sep 28, 2004
Posts: 712



PostPosted: Sun Aug 05, 2007 9:21 am    Post subject: Re: Floating menu bar [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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


"IanB" <Ian@(TakeOut)docspro.co.nz> wrote in message
news:%23BHb%23zt1HHA.5360@TK2MSFTNGP03.phx.gbl...
> 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
>
>
>
Back to top
Jonathan West
External


Since: Dec 18, 2003
Posts: 112



PostPosted: Mon Aug 06, 2007 8:22 am    Post subject: Re: Floating menu bar [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Shauna Kelly" <ShaunaKelly.TakeThisOut@SendNoSpamToShaunaKelly.com> wrote in message
news:esavfv61HHA.5772@TK2MSFTNGP02.phx.gbl...
> 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.
>
>

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.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Back to top
Shauna Kelly
External


Since: Sep 28, 2004
Posts: 712



PostPosted: Mon Aug 06, 2007 6:58 pm    Post subject: Re: Floating menu bar [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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


"Jonathan West" <jwest.DeleteThis@mvps.org> wrote in message
news:uTn6Mu$1HHA.1124@TK2MSFTNGP06.phx.gbl...
>
> "Shauna Kelly" <ShaunaKelly.DeleteThis@SendNoSpamToShaunaKelly.com> wrote in message
> news:esavfv61HHA.5772@TK2MSFTNGP02.phx.gbl...
>> 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.
>>
>>
>
> 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.
>
>
> --
> Regards
> Jonathan West - Word MVP
> www.intelligentdocuments.co.uk
> Please reply to the newsgroup
>
>
Back to top
Jonathan West
External


Since: Dec 18, 2003
Posts: 112



PostPosted: Mon Aug 06, 2007 6:58 pm    Post subject: Re: Floating menu bar [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Shauna Kelly" <ShaunaKelly.DeleteThis@SendNoSpamToShaunaKelly.com> wrote in message
news:eyvXciA2HHA.5616@TK2MSFTNGP04.phx.gbl...
> 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


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Back to top
Ian Bayly
External


Since: Mar 20, 2007
Posts: 5



PostPosted: Thu Aug 09, 2007 2:16 am    Post subject: Re: Floating menu bar [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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





"Jonathan West" <jwest.RemoveThis@mvps.org> wrote in message
news:e4XcTaB2HHA.5164@TK2MSFTNGP05.phx.gbl...
>
> "Shauna Kelly" <ShaunaKelly.RemoveThis@SendNoSpamToShaunaKelly.com> wrote in message
> news:eyvXciA2HHA.5616@TK2MSFTNGP04.phx.gbl...
>> 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
>
>
> --
> Regards
> Jonathan West - Word MVP
> www.intelligentdocuments.co.uk
> Please reply to the newsgroup
>
>
Back to top
Jonathan West
External


Since: Dec 18, 2003
Posts: 112



PostPosted: Thu Aug 09, 2007 12:33 pm    Post subject: Re: Floating menu bar [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Ian Bayly" <IanDBayly RemoveThis @GMail.com> wrote in message
news:%23cA3hkg2HHA.5884@TK2MSFTNGP02.phx.gbl...
> 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!

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.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> User Forms All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum