Quick switch between toolbar layouts

G

Guest

Short Version: Is there a way (programatic, scripting, 3d party plugin,
etc.) to create toolbar layout "profiles" and switch between them. I.e.,
have the toolbars on the right and left, and quickly move them to the top of
the window, and back again.

Long version:
I use two monitors at work, one in portrait and one in landscape. I like
the toolbars on the sides when using the portrait monitor, and on top on the
other. I am looking for a mechanism to adjust toolbar layout based on what
monitor a window is on. I am using Word/Office XP, but will probably be
upgrading to 2003 soon.

I am not afraid to script, so suggestions along those lines would be
welcome. I also realize that what monitor a window is "on" is not
necessarily an "either/or", but since I have the windows maximized and just
swap back and forth from one monitor to another using UltraMon, one can
assume that my windows exist on either one window or the other and not both.
UltraMon is script-friendly, and can report on hardware setups -- see
http://www.realtimesoft.com/multimon/programming/ultramon.asp.

(Plug: if you use multiple monitors, you should have UltraMon, it is the
rare piece of software that just works).
 
S

Shauna Kelly

Hi

You could write a macro to do this. In VBA-speak, each toolbar is a
CommandBar, and each has a read/write .Position property that identifies
whether the bar is at the top, right, floating etc. Look up VBA help under
CommandBars for more information.

It may be useful to know that toolbar positions are saved in the Word Data
registry key. For more information, see
What exactly does the Data Key in the Registry store?
http://www.word.mvps.org/FAQs/Customization/DataKeySettings.htm

If you need further help, I suggest you post questions to one of the
microsoft.public.word.vba newsgroups.

Hope this helps.

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

Guest

The macro below will change the position of all visible toolbars except the
Menu Bar. If the toolbars are docked in top, the macro will dock them left
and vice versa. You may need to add more code if you want to manage the exact
toolbar order etc.

You could assign a keyboard shortcut to the macro so that you can easily
switch the positions.

Sub SwitchToolbarPositions()

Dim oCmdBar As CommandBar

For Each oCmdBar In CommandBars
With oCmdBar
If .Visible = True Then
'Do not move Menu Bar
If .Name <> "Menu Bar" Then
If .Position = msoBarTop Then
.Position = msoBarLeft
Else
.Position = msoBarTop
End If
End If
End If
End With
Next oCmdBar

End Sub

--
Regards
Lene Fredborg
DocTools – Denmark
www.thedoctools.com
Document automation – add-ins, macros and templates for Microsoft Word
 

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