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 / September 2007

Tip: Looking for answers? Try searching our database.

Protect Document Styles Macro in Word 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lisa - 24 Sep 2007 15:10 GMT
Hi,

I've been creating a template in Word 2003 and I don't want people to alter
the styles I have set so I've used the Protect Document setting to limit
formatting to a selection of styles. However, I've noticed that this also
disables various buttons in the toolbar, in particular bold, italic,
underline as well as table formatting.

I've worked out how to create a macro to enable/disable the various styles
using ActiveDocument.Styles("Body").Locked = False but I would like to know
if it's possible to do something similar to allow the bold, italic etc.
buttons to be enabled whilst the rest of styles are protected?

Any help would be greatly appreciated.

Lisa
Graham Mayor - 24 Sep 2007 15:20 GMT
I really don't know why you bother. Give them the template and train them to
use it.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Hi,
>
[quoted text clipped - 13 lines]
>
> Lisa
Shauna Kelly - 24 Sep 2007 15:20 GMT
Hi Lisa

I think the best approach is to create character styles called Bold and
Italic and Underline and whatever (or, use the built-in Strong and Emphasis
styles). And in your template re-map the ordinary Bold and Italic buttons so
they apply your chosen style (to do that, use Tools > Customize etc, create
a button to apply each of your styles, copy the images from the existing
buttons to the new ones, and then delete the old buttons).

You'll need to re-map ctrl-b, ctrl-i, ctrl-u etc, too.

Make sure that your customizations are saved in the template, not in your
normal.dot.

This gives users a consistent interface, but you can retain the protection
for styles.

You might also think about what paragraph settings you want to make
available to users. For example, it bothers me that if I protect a document
for styles, a user can't set a paragraph with "keep with next" or "page
break before". That encourages the really awful habit of inserting manual
page breaks which seriously lowers user productivity as well as having
unfortunate side effects.

Hope this helps.

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

> Hi,
>
[quoted text clipped - 14 lines]
>
> Lisa
Lisa - 24 Sep 2007 17:02 GMT
Hi Shauna

Thank you for your reply. I have considered creating character styles as you
suggest as a work around but I believe only one can be applied at a time and
I wanted to avoid creating lots of styles to cover the main ones which I
think people will use which is why I was looking at seeing if it's possible
to create a macro instead to tone down the protection. I've also noticed that
if some highlighted text is copied into the protected template you then
cannot turn the highlight off.

I have considered not having the protection on at all to solve the issue,
but the intended users will be copying information from documents using older
templates and although I intend to provide training it's a fair bet that some
people will just copy and paste and so new documents created from the
template will get contaminated with unwanted styles.

I like the idea of creating a custom toolbar. Is it  possible to get the
toolbar to behave like the formatting one so that you can apply bold plus
italic rather than having to have a Bold Italic style?

Cheers
Lisa

> Hi Lisa
>
[quoted text clipped - 43 lines]
> >
> > Lisa
Jonathan West - 25 Sep 2007 11:01 GMT
> Hi Shauna
>
[quoted text clipped - 9 lines]
> if some highlighted text is copied into the protected template you then
> cannot turn the highlight off.

If these are important to you, then in my opinion your only practical option
is to turn the protection off, and train the users to use the styles. You
can make it easier for them to remember to use the right styles by making
them more accessible. Take a look at this article for help in that
direction.

Creating Custom Toolbars for Templates
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=262

Signature

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


Rate this thread:






 
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.