|
| View previous topic :: View next topic |
| Author |
Message |
server Guest
|
Posted: Fri Apr 20, 2007 6:26 pm Post subject: Word 2003; Any way to lock toolbars in place? |
|
|
| message unavailable |
|
| Back to top |
|
 |
Google Sponsor

|
Posted: Fri Apr 20, 2007 6:26 pm Post subject: Advertisement |
|
|
|
|
| Back to top |
|
 |
bhoconnor Guest
|
Posted: Fri Apr 20, 2007 6:26 pm Post subject: Re: Word 2003; Any way to lock toolbars in place? |
|
|
Hi,
I tried the suggestion below for locking the toolbar down "completely",
but it isn't working--any ideas? Other suggestions? It is such a pain
when i accidentally move my toolbar or open Word again and find that
I've lost my toolbar set-up.
Thanks,
Brendan
Kristin;5351910 Wrote:
| Quote: | I tried this but may not have done it correctly. Can you provide more
information?
Thanks,
Kristin
"Klaus Linke" wrote:
Hi,
You can do that with a macro... say for the formatting toolbar:
CommandBars("Formatting").Protection=msoBarNoChangeDock XOR
CommandBars("Formatting").Protection
(In case you're wondering about the XOR with the original setting:
This should toggle NoChangeDock and keep the other kinds of protection
untouched... I hope)
This would allow you to move the toolbar around, but not to "rip it
off".
If you want to lock it down completely:
CommandBars("Formatting").Protection=msoBarNoMove XOR
CommandBars("Formatting").Protection
To remove that type of protection, run the same line again.
The easiest way to run one-line macros like this:
-- open the VBA editor (Alt+F11),
-- go into the immediate window (Ctrl+G),
-- copy (Ctrl+C) the line from here and paste (Ctrl+V) it in that
window,
-- hit the Enter or Return key at the end of the line.
There are more types of protection, which you can see in the VBA
editor's help topic on the Protection property (... Hit F1 with the
cursor in the word "Protection", then expand the help topic): Say,
msoBarNoCustomize to disallow customizations in the t
oolbar, or msoBarNoChangeVisible to disallow making the toolbar
invisible (or visible if it's currently invisible).
For the other toolbars you want to lock down, use their names instead
-- say CommandBars("Standard").
Regards,
Klaus
"pb2000" wrote:
|
--
bhoconnor |
|
| Back to top |
|
 |
Klaus Linke Guest
|
Posted: Sun Apr 22, 2007 11:05 pm Post subject: Re: Word 2003; Any way to lock toolbars in place? |
|
|
| Quote: | I tried the suggestion below for locking the toolbar down
"completely", but it isn't working--any ideas?
Other suggestions? It is such a pain when i accidentally
move my toolbar or open Word again and find that
I've lost my toolbar set-up.
|
Hi Brendan,
Seems like my knowledge of Boolean logic is a bit rusty...
I hope the macro below should lock down all toolbars that are currently
visible.
Dim myCB As CommandBar
Dim myProt As Integer
myProt = msoBarNoMove
For Each myCB In CommandBars
' to remove that kind of protection, change <> to =
If myCB.Visible And _
(myCB.Protection And myProt) <> myProt Then
myCB.Protection = myCB.Protection Xor myProt
MsgBox myCB.Protection
End If
Next myCB
Regards,
Klaus |
|
| Back to top |
|
 |
Klaus Linke Guest
|
Posted: Sun Apr 22, 2007 11:25 pm Post subject: Re: Word 2003; Any way to lock toolbars in place? |
|
|
.... and you can delete the line with MsgBox.
I forgot that from debugging.
Klaus |
|
| Back to top |
|
 |
Fred Guest
|
Posted: Thu Apr 26, 2007 7:46 am Post subject: Re: custom menus and toolbars in word 2007 |
|
|
You actually do not have to understand XML and it is a fabulous product with
a free trial.
Also you can add Macros the QAT.
Fred
"Patrick Schmid [MVP]" <pdschmid@nospam.mvps.org> wrote in message
news:%23IN38BTfHHA.4596@TK2MSFTNGP05.phx.gbl...
|
|
| Back to top |
|
 |
Don B Guest
|
Posted: Sat Apr 28, 2007 4:55 pm Post subject: Re: custom menus and toolbars in word 2007 |
|
|
I get an error when I try to load RibbonCustomizer in word 2007 - "Not
Loaded. A runtime error occurred during loading of the COM add in." Any
ideas?
"Fred" <Fred@microsoft.com> wrote in message
news:unpC%23b9hHHA.5008@TK2MSFTNGP02.phx.gbl...
|
|
| Back to top |
|
 |
Patrick Schmid [MVP] Guest
|
|
| Back to top |
|
 |
Don B Guest
|
Posted: Mon Apr 30, 2007 12:17 am Post subject: Re: custom menus and toolbars in word 2007 |
|
|
Still does not work.
"Patrick Schmid [MVP]" <pdschmid@nospam.mvps.org> wrote in message
news:un8fWZeiHHA.4872@TK2MSFTNGP03.phx.gbl...
|
|
| Back to top |
|
 |
Patrick Schmid [MVP] Guest
|
Posted: Mon Apr 30, 2007 2:38 am Post subject: Re: custom menus and toolbars in word 2007 |
|
|
Find my email address on my site and email me. I'll troubleshoot it
directly with you.
"Don B" <batyd@comcast.net> wrote in message
news:epyyc0riHHA.4624@TK2MSFTNGP04.phx.gbl:
|
|
| Back to top |
|
 |
Patrick Schmid [MVP] Guest
|
|
| Back to top |
|
 |
Don B Guest
|
Posted: Sat May 05, 2007 2:24 am Post subject: Re: custom menus and toolbars in word 2007 |
|
|
Works great now. Thanks.
"Patrick Schmid [MVP]" <pdschmid@nospam.mvps.org> wrote in message
news:%234FSBj7iHHA.4676@TK2MSFTNGP02.phx.gbl...
|
|
| Back to top |
|
 |
bhoconnor Guest
|
Posted: Mon May 21, 2007 2:09 pm Post subject: Re: Word 2003; Any way to lock toolbars in place? |
|
|
Hi Klaus,
I thought I posted a response to you, but for some reason i can't find
it in here--did you see my response? I was trying to respond to say that
I don't have much of any knowledge of programming, and was hoping that
you could give me a bit of a 101 on how to do what you mention above;
that would be great if possible--thanks so much!
Brendan
Klaus Linke;7532020 Wrote:
| Quote: | .... and you can delete the line with MsgBox.
I forgot that from debugging.
Klaus
|
--
bhoconnor |
|
| Back to top |
|
 |
Klaus Linke Guest
|
Posted: Mon May 21, 2007 3:43 pm Post subject: Re: Word 2003; Any way to lock toolbars in place? |
|
|
Hi Brendan,
General tips for getting the code to run:
http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm
The code I posted should do what it was supposed to do: Lock down all
toolbars that are currently visible so they can't be moved any more.
Some annotations if you want to understand/modify the code:
| Quote: | Dim myCB As CommandBar
|
Toolbars are CommandBars in VBA lingo (... and so is the menu bar BTW).
| Quote: | Dim myProt As Integer
myProt = msoBarNoMove
|
CommandBars have a "Protection" property, of data type Integer, which can be
read or set.
It's a bit tricky though. There are different kinds of protection, and every
one of them has a MsoBarProtection constant that is a power of 2:
msoBarNoProtection = 0
msoBarNoCustomize = 1
msoBarNoResize = 2
msoBarNoMove = 4
msoBarNoChangeVisible = 8
msoBarNoChangeDock = 16
msoBarNoVerticalDock = 32
msoBarNoHorizontalDock = 64
To get a combination of different protections, you add up the corresponding
constants.
Say for a toolbar that can't be docked, you might use msoBarNoVerticalDock +
msoBarNoHorizontalDock = 32 + 64 = 96.
If you've heard about the binary number system, you could write down the
integer as a binary number:
In binary notation, the number 96 is 1100000.
Every bit in the binary representation corresponds to one type of protection
(first bit set to 1 = NoCustomize, second bit = NoResize ...).
The macro code is a bit complicated because if you want to set or remove
some kind protection, you usually don't want to change the other kinds of
protection. That's where the Boolean operators "And" and "XOR" for
manipulating binary numbers come in handy.
| Quote: | For Each myCB In CommandBars
' to remove that kind of protection, change <> to =
If myCB.Visible And _
(myCB.Protection And myProt) <> myProt Then
myCB.Protection = myCB.Protection Xor myProt
End If
Next myCB
|
The code loops all CommandBars.
It checks if the command bar is visible (If myCB.Visible), and if the
current protection doesn't already contain the desired kind of protection
((myCB.Protection And myProt) <> myProt).
If those conditions are met, the kind of protection specified in myProt is
toggled (myCB.Protection = myCB.Protection Xor myProt).
Regards,
Klaus
"bhoconnor" wrote:
| Quote: |
Hi Klaus,
I thought I posted a response to you, but for some reason i can't find
it in here--did you see my response? I was trying to respond to say that
I don't have much of any knowledge of programming, and was hoping that
you could give me a bit of a 101 on how to do what you mention above;
that would be great if possible--thanks so much!
Brendan |
|
|
| Back to top |
|
 |
HÃ¥kan Ljungqvist Guest
|
Posted: Tue Oct 02, 2007 10:22 am Post subject: Re: Missing menus in Insert > Autotext > Header/Footer. Word |
|
|
I want to insert the filename in the Footer, but I have the same problem
with the little square stump instead of the Intsert Autotext list.
Delete Normal.dot didn't help.
I can insert it manually by
Insert > Autotext > Autotext...
A "Autocorrect window" opens
Autotext > Mark "Filenamn" > Press insert
This will write the filename in the document. But it's easier if I could use
Insert Autotext in Header & Footer. |
|
| Back to top |
|
 |
Graham Mayor Guest
|
Posted: Tue Oct 02, 2007 10:49 am Post subject: Re: Missing menus in Insert > Autotext > Header/Footer. Word |
|
|
Losing the filename autotext from the header footer view is usually as a
result of replacing normal.dot with your own document template (only Word
can create normal.dot). However it is easy enough to resolve. Insert the
filename field into the footer and save the inserted field as an autotext
entry with the original name (filename or filename and path). This will
replace the original entry and make it available from the header/footer
toolbar.
The following macro added to a toolbar button will insert the filename and
path fields in the footer of the last page.
Sub InsertFilenameinLastPageFooter()
With ActiveDocument
If Len(.Path) = 0 Then
.Save
End If
End With
Selection.EndKey Unit:=wdStory
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
With Selection
.ParagraphFormat.Alignment = wdAlignParagraphRight
.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
.TypeText Text:="IF"
.Fields.Add Range:=Selection.Range, Type:=wdFieldPage, _
PreserveFormatting:=False
.TypeText " = "
.Fields.Add Range:=Selection.Range, Type:=wdFieldNumPages, _
PreserveFormatting:=False
.TypeText " "
.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
.TypeText Text:="Filename \p"
.EndKey Unit:=wdStory
.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
.Fields.Update
End With
With ActiveWindow.ActivePane.View
.ShowFieldCodes = False
.SeekView = wdSeekMainDocument
End With
End Sub
http://www.gmayor.com/installing_macro.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Håkan Ljungqvist <hakan@sthlmNOSPAM.com> wrote:
| Quote: | I want to insert the filename in the Footer, but I have the same
problem with the little square stump instead of the Intsert Autotext
list.
Delete Normal.dot didn't help.
I can insert it manually by
Insert > Autotext > Autotext...
A "Autocorrect window" opens
Autotext > Mark "Filenamn" > Press insert
This will write the filename in the document. But it's easier if I
could use Insert Autotext in Header & Footer. |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot 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
|
|
|