prevent WORD name style changes

D

Dennis S

WORD 2003 - I have set the document protecion and restricted format and style
changes. However, the user is able to change the name of any built-in style
if they include a comma. Once changed ,there ias no way to change it except
to remove the protecion and modify the style name in the "Name" field. (i.e.
Heading 1 changed to Heading 1, den)
 
C

Charles Kenyon

They are not changing the style. They are not changing the style name of
"Heading 1." They are adding a shortcut or nickname to the style name. And
your problem with this is?...
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
D

Dennis S

We have a custom solution where we provide a standardized template of styles
that users should be using to apply against the document for consistency. In
the example I gave, "Heading 1" is no longer a valid style, it is now
"Heading 1, den". However, Heading 1,den is not a valid controlled style
name and the user cannot reset it easily back to Heading 1.

You mention shortcut. How does the shortcut work? Is it documented
somewhere????
 
C

Charles Kenyon

"Heading 1" will still work AFAIK. It certainly works for manual insertion.
Haven't tried it with vba.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
D

Dennis S

The problem is that WORD has a feature to protect a document by restricting
style and formatting changes. This now allows a style change (the name that
is). We have a check that verifies that every style in a document matches a
style in our controlled Styles template. Being able to change "Heading 1" to
"Heading 1, den" will not match a style in our "styles" template.
 
S

Shauna Kelly

Hi Dennis

I can understand that you are frustrated that Word's feature to constrain
users to using certain styles does not prevent their adding a nickname to a
style.

I wonder if this would help.

All the built-in styles have a enumerated value that is (a) independent of
the local name of the style (and by "local" I mean the language of Word:
"Heading 1" isn't "Heading 1" in, say, Swedish) and (b) independent of any
short or nickname that a user may have given it.

So your code can refer to, say, ActiveDocument.Styles(wdHeading1) without
needing to know the local name of the style. That makes for more robust
code, because it will run no matter what language version the user has, and
what nickname the user may have given to a style.

You can get a full list of the enumerated values at View > Object Browser
(search for wdStyle).

For what it's worth, I often observe that nicknames get added to a style in
a document when people copy and paste text from another document (where that
'other document' has given a nickname to a style). It's impossible for a
user to detect that they are about to paste text into their Word document
that will add a nickname to a style. And Word does not see this as violating
the constraint to use certain styles.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/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