Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Finding an Unknown Character.

Finding an Unknown Character

Written by Allen Wyatt (last updated October 26, 2023)
This tip applies to Word 97, 2000, 2002, and 2003


1

Word documents can contain just about any character you can think of—and many you can't. If you inherit documents from other people, or cut and paste information from other sources, it is possible to end up with characters in Word that you don't know how to identify. If you can't identify them, then it makes it very hard to search and replace them. Sometimes Word will allow you to copy the character and paste it into the Find box when searching, but you can only do this with a limited number of characters.

The answer to this conundrum is to identify, specifically, the character in question. Then you can use the special features of the Find box to locate it. The first step is to create this macro:

Public Sub GetCharASCII()
    MsgBox "CharCode is: " & Asc(Selection)
End Sub

Next, select the single character that you have a question about and run the macro. You will see a dialog box that tells you the ASCII value of the character. For instance, let's say that the character value returned is 148. You would then use the following in the Find box:

^148

Word will now find all instances of the character in question, and you can replace it as desired.

If you still have a stubborn character that this won't work for—for instance, some Unicode characters—then a different approach is required. If you fit into this category, refer to the following article at the Word MVP site:

https://wordmvp.com/FAQs/MacrosVBA/FindReplaceSymbols.htm

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1613) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Finding an Unknown Character.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Hiding Rows Based on a Cell Value

This tip contains a macro to hide rows that contain data you don't want to see.

Discover More

Jumping To a Specific Page

Want to jump to a specific printed page within a worksheet? It's not as easy as you might think, but here's some ...

Discover More

Understanding the LET Function

The LET function provides an easy way to define and use variables within a formula. This tip shows you how you can start ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (menu)

Finding and Deleting Rows

Got a table that contains rows you want to delete? Deleting one or two rows in a table is easy; deleting a bunch of rows ...

Discover More

Removing HTTP from URLs

Having problems when it comes to replacing information in URLs? You're not the only one; it can be confusing making mass ...

Discover More

Preserving Bookmarks During Replace Operations

When you do a search and replace operation in Word, it is possible that you could inadvertently wipe out a bookmark or ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 2?

2020-10-07 04:46:13

Paul

Allen - thank you for this post. However, I'm not having much success with the output of this macro, in practice. I have a document that uses a large dot symbol that looks like an oversized "dot operator" (unicode 22C5) or "middle dot" (unicode 00B7) - somewhat like a dot-style bullet. However, your macro is returning "CharCode is: 40", and online ASCII tables list value 40 as being for "open parenthesis". I see in your post above that you link to another article that might be useful for what you call "stubborn" characters, but that page seems to be focused on find-replace, and the following macro described on that page doesn't actually display any code for the character in question:
==
Sub GetCharNoAndFont()

With Dialogs(wdDialogInsertSymbol)
Debug.Print "Font: " & .Font
Debug.Print "Char number " & .CharNum
End With

End Sub
==

So, I'm a bit stuck! How would one use the information in that MVP article to modify your macro above to display the unicode character number?


This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.