June 15, 2017

Code Searching

Filed under: Main — Tags: — admin @ 12:01 am

A friend of my discovered an interesting trick for Microsoft Word, something I wasn’t aware of. Buried within the old Find command, what Word 2016 calls “Advanced Find,” you can search for character codes.

Yeah, this revelation may not launch your rocket, but it makes me all gooey.

The Advanced Find command is basically the old Find dialog box, what would appear when you pressed the Ctrl+F keyboard shortcut to hunt down text in versions of Word prior to 2007. Today, pressing Ctrl+F shows the Navigation pane, which is handy, but not what many users want.

To summon the traditional Find dialog box, click the Home tab. In the Editing group (on the far right), choose Find, Advanced Find. The Find and Replace dialog box is shown in Figure 1. It shares tabs with the Replace (Ctrl+H) and Go To (Ctrl+G) commands.

Figure 1. The Advanced Find dialog box.

When you want to search for a character you can’t easily type in at the keyboard, click the More button and choose the character from the Special menu. This process is covered in my Word For Dummies books. What happens is that a special code is inserted into the Find What text box, usually some letter prefixed by the ^ caret character.

For example, to search for a paragraph marker, you use the ^p code. And, because you’re thinking of it, to search for the caret character, you use ^^.

Quite a few untypeable character codes are available, such as tab, page break, spaces, and so on. When a character isn’t available, you can use its secret code for searching. That’s what my friend discovered.

In this case, he was looking for linefeed characters in a text document. The linefeed character code is 10. To search for character code 10 in a document, you type ^010 into the Find What text box. ^0 (caret zero) is the prefix that tells Word whatever follows is a character code.

Yes, I might have lost you.

Nerds love the character codes, which is probably why the undocumented ^000 code thing exists. You can, however, try out the secret on any document:

1. Summon the Advanced Find dialog box.
2. Into the Find What text box, type ^065
3. Click the Find Next button.

In the document, the next instance of the lowercase letter A is found and highlighted. That’s because 65 is the character code for the lowercase A.

How useful is this trick? Not very. Only nerds will probably use it because only a nerd would use Word to edit a plain text document that contained unwanted codes. For most humans, you would open the document using the tool Recover Text From Any File and then deal with whatever results you may find.

2 Comments

  1. Nutz, I needed that ages ago once…

    Comment by glennp — June 15, 2017 @ 4:40 am

  2. When he showed it to me, it had a familiar ring. So I think I knew this trick long ago, but forgot it. Still, it saved him from having to write a macro to do the same.

    Comment by admin — June 15, 2017 @ 7:38 am

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.


Powered by WordPress