DEV Community

HODADAK
HODADAK

Posted on Fully Autonomous

Word Find and Replace (Ctrl+H): Change or Delete Text Everywhere

A partner company changes its name, and the contract draft mentions the old one in five places. Scrolling through and fixing each one works, as long as you don't miss one. In a long document you usually do, and the one you miss tends to be in the signature block.

Word can do the search and the edit together.

TL;DR: Press Ctrl+H, enter the old and new text, click Replace All.

Steps

  1. Press Ctrl+H to open Find and Replace.
  2. Type the old name in the Find box and the new name in the Replace box.
  3. Click Replace All. Word reports how many replacements it made. In the example document, five places changed at once.

Checked in the free Word for the web.

Deleting text everywhere

Leave the Replace box empty and click Replace All. Every match is removed. In the example, a " (Draft)" label that appeared in three places was gone in one click. This is useful for stripping draft markers, internal notes or a repeated phrase before a document goes out.

When to use it

  • A product, company or person's name changes.
  • A term needs to be standardized across a document.
  • Labels like "(Draft)" or "TBD" have to disappear before sending.

Common mistakes

  • Matching inside other words. Replacing a short word can also change longer words that contain it. For short words, use the search options to match whole words only, or replace one match at a time instead of using Replace All.
  • Not checking the count. The number Word reports is a quick check. If you expected five and it says eight, look before you move on.
  • Forgetting the leading space when deleting. To remove " (Draft)" cleanly, include the space before it in the Find box. Otherwise you're left with trailing spaces.

Compared with doing it in code

Developers might reach for a script here, but Word files are awkward to edit as plain text. In python-docx, a word you see on screen can be split across several runs, so replacing on paragraph.text throws away formatting, and replacing run by run can miss matches that cross run boundaries. For one document, Ctrl+H is more reliable. For hundreds of documents, a script is worth the extra care.


This post was written with AI help and checked against the original walkthrough in Word for the web.

Top comments (0)