.Styles.Add problem

K

Ken K

I've run into a problem with case sensitivity and .Styles.Add.

Style names are case sensitive (a document can contain styles named "atest"
and "ATEST" at the same time). You can add case sensitive style names
manually but not using .Styles.Add. For example if I:

1. Add a style named "ATEST" to a document.

2. Run one line macro:
ActiveDocument.Styles.Add "atest"

I get error 5173 "This style name already exists or is reserved for a
built-in style."

But if use Format>Style...>New to add a style named "ATEST" to a document
and then use Format>Style...>New to add another style named "atest" to the
same document there's no problem and both styles co-exist happily.

Is there any way around the case-sensitivity of .Styles.Add or am I going to
have to rethink the style names? There's several million documents involved
in this situation so obviously changing the style names is not trivial.

Many thanks for any thoughts...
 

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