Here's the scenario: You open a giant document from a client and start looking through it. But what's this? The same odd character at the beginning of every paragraph. Must be some kind of file translation error. Odder still, Microsoft Word won't let you paste the character into its Find and Replace dialog, so how are you going to get rid of them all? By hand? Horrors!
If you knew the character's numeric code, you could search for it, as explained in our last newsletter:
http://www.topica.com/lists/editorium/read/message.html?sort=d&mid=1704081834
But this character isn't on the usual list. How can you find out its numeric code? By using our trusty NextCharacter macro:
FOR MICROSOFT WORD 6 OR 7 (95):
'THE MACRO STARTS HERE
NextChar$ = Str$(Asc(Selection$()))
MsgBox "The code for the next character is "
+ NextChar$ + ".", "Next Character"
'Macro ends here
FOR MICROSOFT WORD 8 (97 OR 98) OR 9 (2000 OR 2001):
'Macro starts here
Dim NextChar$
NextChar$ = Str(Asc(WordBasic.[Selection$]()))
WordBasic.MsgBox _
"The code for the next character is " + NextChar$ + ".", _
"Next Character"
'THE MACRO ENDS HERE
TO CREATE THE MACRO
1. Copy the appropriate macro from this newsletter.
2. Click the "Tools" menu at the top of your Word window.
3. Click "Macro."
4. In Word 97, 98, 2000, or 2001, click "Macros."
5. Make sure "Macros Available In" shows "Normal.dot."
6. Type a name for the macro in the "Macro Name" box--"NextCharacter" should do nicely.
7. Click "Create."
8. Paste the macro at the current insertion point.
9. In Word 6 or 7, click "File," then "Close," then "Yes." In Word 97, 98, 2000, or 2001, click "File," then "Close and Return to Microsoft Word."
TO RUN THE MACRO:
1. Put your cursor in front of the character whose numeric code you want to know.
2. Click the "Tools" menu at the top of your Word window.
3. Click "Macro."
4. In Word 97, 98, 2000, or 2001, click "Macros."
5. Make sure "Macros Available In" shows "Normal.dot."
6. Select the macro (probably "NextCharacter") in the "Macro Name" box.
7. Click "Run."
After you run the macro, a message box will appear on your screen with the numeric code you need.