dlw said:
I have a macro that sets a paragraph style with all caps
that works perfectly. However, the letters are lowercase in
the Document Map. How can I solve this without having to
press 'Caps Lock'?
First, be clear on what you're doing now: the characters are stored as they
were originally typed (lower case or mixed case, as might be), and the
style's "All caps" attribute is merely changing the way the characters are
displayed. The Document Map is looking at the stored characters and ignoring
the style.
Since this bothers you, the solution is to make the stored characters really
upper case, and not just display them that way.
Assuming your macro has already assigned a Range object (which I'll call
oRg) to point to the paragraph that should receive the style, you can do
this:
oRg.Case = wdUpperCase
Then the "All caps" setting in the style is redundant.
Note that this may have knock-on effects on other automatically generated
items such as the table of contents, index, and StyleRef fields. You might
be better advised to simply take the Document Map as it is.