caps in macros

D

dlw

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'?
 
J

Jay Freedman

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.
 

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