How to bold all instances of the same word in a Word document?
If there are multiple “outlook” texts in your Word file, now you need to format all the “outlook” texts as bold. How could you bold all instances of the same word in a large Word document as quickly as possible?
Bold all instances of the same word in a Word document with VBA code
Bold all instances of the same word in a Word document with VBA code
The following VBA code can help you to bold all instances of a specific word quickly and easily, please do as this:
1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.
2. And then, click Insert > Module, copy and paste below code into the opened blank module:
VBA code: Bold all instances of the same word
Sub BoldAll()
Dim xStr As String
xStr = InputBox("Please enter the word that you want to bold:", "KuTools for Word")
If Trim(xStr) = "" Then
MsgBox "Cann’t be empty!", vbInformation, "KuTools for Word"
End If
With ActiveDocument.Content.Find
.ClearFormatting
.Text = xStr
.Replacement.ClearFormatting
.Replacement.Font.Bold = True
.Replacement.Text = "^&"
.Wrap = wdFindStop
.Format = True
.Forward = True
.Execute Replace:=wdReplaceAll
End With
End Sub
3. After inserting the code, and then press F5 key to run it, and a dialog box is popped out to remind you inserting the word that you want to bold, see screenshot:
4. And then, click OK button, and all the specific words have been formatted as bold at once.
Best Office Productivity Tools
Kutools for Word - Elevate Your Word Experience with Over 100 Remarkable Features!
🤖 Kutools AI Assistant: Transform your writing with AI - Generate Content / Rewrite Text / Summarize Documents / Inquire for Information based on Document, all within Word
📘 Document Mastery: Split Pages / Merge Documents / Export Selection in Various Formats (PDF/TXT/DOC/HTML...) / Batch Convert to PDF / Export Pages as Images / Print Multiple Files at once...
✏ Contents Editing: Batch Find and Replace across Multiple Files / Resize All Pictures / Transpose Table Rows and Columns / Convert Table to Text...
🧹 Effortless Clean: Sweap away Extra Spaces / Section Breaks / All Headers / Text Boxes / Hyperlinks / For more removing tools, head to our Remove Group...
➕ Creative Inserts: Insert Thousand Separators / Check Boxes / Radio Buttons / QR Code / Barcode / Diagonal Line Table / Equation Caption / Image Caption / Table Caption / Multiple Pictures / Discover more in the Insert Group...
🔍 Precision Selections: Pinpoint specific pages / tables / shapes / heading paragraphs / Enhance navigation with more Select features...
⭐ Star Enhancements: Navigate swiftly to any location / auto-insert repetitive text / seamlessly toggle between document windows / 11 Conversion Tools...