Computer Forum Forum Index
Register  FAQ Profile Log in to check your private messages Log in Register 

Word 2003; Any way to lock toolbars in place?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Computer Forum Forum Index -> word customization menustoolbars
View previous topic :: View next topic  
Author Message
server
Guest





PostPosted: Fri Apr 20, 2007 6:26 pm    Post subject: Word 2003; Any way to lock toolbars in place? Reply with quote

message unavailable
Back to top
Google
Sponsor





PostPosted: Fri Apr 20, 2007 6:26 pm    Post subject: Advertisement

Back to top
bhoconnor
Guest





PostPosted: Fri Apr 20, 2007 6:26 pm    Post subject: Re: Word 2003; Any way to lock toolbars in place? Reply with quote

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





PostPosted: Sun Apr 22, 2007 11:05 pm    Post subject: Re: Word 2003; Any way to lock toolbars in place? Reply with quote

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





PostPosted: Sun Apr 22, 2007 11:25 pm    Post subject: Re: Word 2003; Any way to lock toolbars in place? Reply with quote

.... and you can delete the line with MsgBox.
I forgot that from debugging.

Klaus
Back to top
Fred
Guest





PostPosted: Thu Apr 26, 2007 7:46 am    Post subject: Re: custom menus and toolbars in word 2007 Reply with quote

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...
Quote:
You will have to use RibbonX: http://pschmid.net/office2007/ribbonx

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

"sajid307 via OfficeKB.com" <u2706@uwe> wrote in message
news:7097f15a4bc0e@uwe:

Hello,

How we can customize the menus in word 2007? e.g. I have a macro and want
to
add this as a menu item into one the custom built menus!

I know how to do in 2003, which is Tools>Customize> and then drag and
drop,
but cant figure out how to do it in 2007. Can anyone help?

Thanks

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-menus/200704/1
Back to top
Don B
Guest





PostPosted: Sat Apr 28, 2007 4:55 pm    Post subject: Re: custom menus and toolbars in word 2007 Reply with quote

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...
Quote:
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...
You will have to use RibbonX: http://pschmid.net/office2007/ribbonx

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

"sajid307 via OfficeKB.com" <u2706@uwe> wrote in message
news:7097f15a4bc0e@uwe:

Hello,

How we can customize the menus in word 2007? e.g. I have a macro and
want to
add this as a menu item into one the custom built menus!

I know how to do in 2003, which is Tools>Customize> and then drag and
drop,
but cant figure out how to do it in 2007. Can anyone help?

Thanks

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-menus/200704/1


Back to top
Patrick Schmid [MVP]
Guest





PostPosted: Sat Apr 28, 2007 10:41 pm    Post subject: Re: custom menus and toolbars in word 2007 Reply with quote

Remove it and install the latest version:
http://pschmid.net/office2007/ribboncustomizer/download.php
V1.0 didn't work under Vista if you were an administrative user and had
User Account Control turned off. This problem has been fixed in V1.1
(available since this morning).

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

"Don B" <batyd@comcast.net> wrote in message
news:uke6XYbiHHA.1216@TK2MSFTNGP03.phx.gbl:

Quote:
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...
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...
You will have to use RibbonX: http://pschmid.net/office2007/ribbonx

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

"sajid307 via OfficeKB.com" <u2706@uwe> wrote in message
news:7097f15a4bc0e@uwe:

Hello,

How we can customize the menus in word 2007? e.g. I have a macro and
want to
add this as a menu item into one the custom built menus!

I know how to do in 2003, which is Tools>Customize> and then drag and
drop,
but cant figure out how to do it in 2007. Can anyone help?

Thanks

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-menus/200704/1


Back to top
Don B
Guest





PostPosted: Mon Apr 30, 2007 12:17 am    Post subject: Re: custom menus and toolbars in word 2007 Reply with quote

Still does not work.
"Patrick Schmid [MVP]" <pdschmid@nospam.mvps.org> wrote in message
news:un8fWZeiHHA.4872@TK2MSFTNGP03.phx.gbl...
Quote:
Remove it and install the latest version:
http://pschmid.net/office2007/ribboncustomizer/download.php
V1.0 didn't work under Vista if you were an administrative user and had
User Account Control turned off. This problem has been fixed in V1.1
(available since this morning).

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

"Don B" <batyd@comcast.net> wrote in message
news:uke6XYbiHHA.1216@TK2MSFTNGP03.phx.gbl:

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...
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...
You will have to use RibbonX: http://pschmid.net/office2007/ribbonx

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In:
http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

"sajid307 via OfficeKB.com" <u2706@uwe> wrote in message
news:7097f15a4bc0e@uwe:

Hello,

How we can customize the menus in word 2007? e.g. I have a macro and
want to
add this as a menu item into one the custom built menus!

I know how to do in 2003, which is Tools>Customize> and then drag and
drop,
but cant figure out how to do it in 2007. Can anyone help?

Thanks

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-menus/200704/1



Back to top
Patrick Schmid [MVP]
Guest





PostPosted: Mon Apr 30, 2007 2:38 am    Post subject: Re: custom menus and toolbars in word 2007 Reply with quote

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:

Quote:
Still does not work.
"Patrick Schmid [MVP]" <pdschmid@nospam.mvps.org> wrote in message
news:un8fWZeiHHA.4872@TK2MSFTNGP03.phx.gbl...
Remove it and install the latest version:
http://pschmid.net/office2007/ribboncustomizer/download.php
V1.0 didn't work under Vista if you were an administrative user and had
User Account Control turned off. This problem has been fixed in V1.1
(available since this morning).

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

"Don B" <batyd@comcast.net> wrote in message
news:uke6XYbiHHA.1216@TK2MSFTNGP03.phx.gbl:

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...
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...
You will have to use RibbonX: http://pschmid.net/office2007/ribbonx

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In:
http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

"sajid307 via OfficeKB.com" <u2706@uwe> wrote in message
news:7097f15a4bc0e@uwe:

Hello,

How we can customize the menus in word 2007? e.g. I have a macro and
want to
add this as a menu item into one the custom built menus!

I know how to do in 2003, which is Tools>Customize> and then drag and
drop,
but cant figure out how to do it in 2007. Can anyone help?

Thanks

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-menus/200704/1



Back to top
Patrick Schmid [MVP]
Guest





PostPosted: Tue May 01, 2007 6:19 am    Post subject: Re: custom menus and toolbars in word 2007 Reply with quote

I found and fixed the issue. Thank you for your help.
Explanation and link to download fixed version:
http://pschmid.net/blog/2007/05/01/120

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

"Patrick Schmid [MVP]" <pdschmid@nospam.mvps.org> wrote in message
news:e0#wmCtiHHA.2408@TK2MSFTNGP02.phx.gbl:

Quote:
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:

Still does not work.
"Patrick Schmid [MVP]" <pdschmid@nospam.mvps.org> wrote in message
news:un8fWZeiHHA.4872@TK2MSFTNGP03.phx.gbl...
Remove it and install the latest version:
http://pschmid.net/office2007/ribboncustomizer/download.php
V1.0 didn't work under Vista if you were an administrative user and had
User Account Control turned off. This problem has been fixed in V1.1
(available since this morning).

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

"Don B" <batyd@comcast.net> wrote in message
news:uke6XYbiHHA.1216@TK2MSFTNGP03.phx.gbl:

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...
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...
You will have to use RibbonX: http://pschmid.net/office2007/ribbonx

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In:
http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

"sajid307 via OfficeKB.com" <u2706@uwe> wrote in message
news:7097f15a4bc0e@uwe:

Hello,

How we can customize the menus in word 2007? e.g. I have a macro and
want to
add this as a menu item into one the custom built menus!

I know how to do in 2003, which is Tools>Customize> and then drag and
drop,
but cant figure out how to do it in 2007. Can anyone help?

Thanks

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-menus/200704/1



Back to top
Don B
Guest





PostPosted: Sat May 05, 2007 2:24 am    Post subject: Re: custom menus and toolbars in word 2007 Reply with quote

Works great now. Thanks.
"Patrick Schmid [MVP]" <pdschmid@nospam.mvps.org> wrote in message
news:%234FSBj7iHHA.4676@TK2MSFTNGP02.phx.gbl...
Quote:
I found and fixed the issue. Thank you for your help.
Explanation and link to download fixed version:
http://pschmid.net/blog/2007/05/01/120

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

"Patrick Schmid [MVP]" <pdschmid@nospam.mvps.org> wrote in message
news:e0#wmCtiHHA.2408@TK2MSFTNGP02.phx.gbl:

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:

Still does not work.
"Patrick Schmid [MVP]" <pdschmid@nospam.mvps.org> wrote in message
news:un8fWZeiHHA.4872@TK2MSFTNGP03.phx.gbl...
Remove it and install the latest version:
http://pschmid.net/office2007/ribboncustomizer/download.php
V1.0 didn't work under Vista if you were an administrative user and
had
User Account Control turned off. This problem has been fixed in V1.1
(available since this morning).

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update:
http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In:
http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

"Don B" <batyd@comcast.net> wrote in message
news:uke6XYbiHHA.1216@TK2MSFTNGP03.phx.gbl:

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...
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...
You will have to use RibbonX:
http://pschmid.net/office2007/ribbonx

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In:
http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed

"sajid307 via OfficeKB.com" <u2706@uwe> wrote in message
news:7097f15a4bc0e@uwe:

Hello,

How we can customize the menus in word 2007? e.g. I have a macro
and
want to
add this as a menu item into one the custom built menus!

I know how to do in 2003, which is Tools>Customize> and then
drag and
drop,
but cant figure out how to do it in 2007. Can anyone help?

Thanks

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-menus/200704/1




Back to top
bhoconnor
Guest





PostPosted: Mon May 21, 2007 2:09 pm    Post subject: Re: Word 2003; Any way to lock toolbars in place? Reply with 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

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





PostPosted: Mon May 21, 2007 3:43 pm    Post subject: Re: Word 2003; Any way to lock toolbars in place? Reply with quote

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





PostPosted: Tue Oct 02, 2007 10:22 am    Post subject: Re: Missing menus in Insert > Autotext > Header/Footer. Word Reply with 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
Graham Mayor
Guest





PostPosted: Tue Oct 02, 2007 10:49 am    Post subject: Re: Missing menus in Insert > Autotext > Header/Footer. Word Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    Computer Forum Forum Index -> word customization menustoolbars All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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
Computer Forum