Create an Automatic Keyword Checklist in Microsoft Word
Question details
The user wants to compare an assignment against a source keyword list, highlight matches, and identify missing terms.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Check an assignment against a separate list of required keywords.
- Observed behavior
- The desired result is a document with matching keywords highlighted and a report of terms that are absent.
Put each keyword on a separate line in a plain-text file and open the assignment in desktop Word. For the macro, save the keyword file in a text encoding supported by your system and make sure you can access Word's VBA editor.
Use a Word VBA macro to highlight keywords and report missing terms
Use this approach for repeated checks against a plain-text keyword list.
Word does not have a built-in automatic cross-document checklist for this workflow. This macro searches the assignment's main text, highlights matches in yellow, and displays missing terms.
The search is case-insensitive and matches parts of words. It checks nonoverlapping occurrences in the main document body, not text in headers, footers, or text boxes. Existing highlights are not removed.
Open the assignment in desktop Word, then press Alt+F11 or choose Developer > Visual Basic. If the Developer tab is hidden, enable it in Word's ribbon settings.
In the VBA editor, select the assignment's project, choose Insert > Module, and paste this code: Sub CheckKeywordList() Dim doc As Document Dim searchRange As Range Dim picker As Object Dim filePath As String, keyword As String, missing As String Dim fileNumber As Integer, found As Boolean Set doc = ActiveDocument Set picker = Application.FileDialog(3) With picker .Title = "Select the keyword text file" .Filters.Clear .Filters.Add "Text files", "*.txt" .AllowMultiSelect = False If .Show <> -1 Then Exit Sub filePath = .SelectedItems(1) End With fileNumber = FreeFile Open filePath For Input As #fileNumber Do Until EOF(fileNumber) Line Input #fileNumber, keyword keyword = Trim$(keyword) If Len(keyword) > 0 Then If Len(Replace(keyword, "^", "^^")) > 255 Then missing = missing & vbCrLf & keyword & " (too long to search)" Else found = False Set searchRange = doc.Content With searchRange.Find .ClearFormatting .Text = Replace(keyword, "^", "^^") .Forward = True .Wrap = wdFindStop .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Do While searchRange.Find.Execute found = True searchRange.HighlightColorIndex = wdYellow searchRange.Collapse wdCollapseEnd Loop If Not found Then missing = missing & vbCrLf & keyword End If End If Loop Close #fileNumber If missing = "" Then MsgBox "All listed keywords were found, or the list was empty." Else MsgBox "Missing or not searched:" & missing End If End Sub
Return to the assignment, choose Developer > Macros, select CheckKeywordList, and click Run. In the file picker, select the keyword .txt file.
Read the missing-term message and review the yellow highlights in the document. Use File > Save As and choose a macro-enabled Word document (.docm) if you want to keep the macro in the assignment.

Check a short keyword list with Word Find
Use manual searching when there are only a few terms or macros are unavailable.
Review Word documents with WPS Writer
WPS Office is a free, lightweight alternative with a familiar interface for opening and reviewing Word documents. Use WPS Writer to find and highlight keywords manually; it does not fix Word's automatic checklist limitation.

Frequently Asked Questions
Can Word automatically compare an assignment with a keyword list?
Word has no built-in automatic cross-document checklist for this exact workflow. In desktop Word, a VBA macro can read a keyword list, search the assignment, and report missing terms.
How should I prepare the keyword file for the macro?
Save the list as a plain-text .txt file with one keyword or phrase per line. When you run CheckKeywordList from Developer > Macros, select that file in the picker.
Will the macro match keywords inside longer words?
Yes. The example sets MatchWholeWord to False, so a keyword can match part of a longer word. Change it to True in the VBA editor if you need whole-word matches.
Does the macro search headers and text boxes?
No. The example searches the main document body through doc.Content. Headers, footers, and text boxes require additional VBA code.
How can I check keywords without a macro?
Choose Home > Find in Word and search for each term. Highlight matching text with Home > Text Highlight Color and record any terms with no results separately.




