AllCaps question

G

George Seese

Word2000 code:
---
With Selection.Find
.Forward = True
.ClearFormatting
.MatchWholeWord = True
.MatchCase = True
.Execute findtext:="COMPANYNAME"
If .Found = true Then
If Selection.Font.AllCaps = False Then
Selection.Font.AllCaps = True
End If
End If
End With
 
J

Jay Freedman

Hi, George,

Word makes a distinction between the "real" case of a character (that is,
the ANSI or Unicode value stored in the file) and the "displayed" case. The
AllCaps font property affects only the displayed case.

For example, if you type the character "a" in the document, then go into
Format > Font and check the box for AllCaps, the character will display as
"A". But Word still knows that it's really lower case, because you can go
back into the Font dialog and uncheck the AllCaps item, and the character
will go back to "a".

However, if you initially type "A" and then turn on AllCaps, it doesn't
alter the display; and if you go back and turn off AllCaps, it still doesn't
alter the display -- because the character really is "A".

What's happening in your macro is that the word you're finding was typed in
capital letters, and it does not have the AllCaps property turned on. Your
macro is turning on AllCaps, but you won't see any difference in the display
(except that the box in the Font dialog will now be checked).
 
G

George Seese

Jay,
Thanks, very interesting and helpful.
Even tho a word is typed in all capital letters, it does not set the AllCaps
property to true.
George
 

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