How to Assign a Custom Word Dictionary with VBA at Startup
Question details
The user needs to assign a custom spelling dictionary using a Word VBA macro when a document opens, but clearing existing dictionaries prevents the new one from functioning automatically.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Running a Document_Open VBA macro to set a specific custom dictionary (.dic) for spell checking upon opening a file.
- Observed behavior
- Using CustomDictionaries.ClearAll before adding the new dictionary causes Word to ignore the newly added dictionary, requiring the user to manually select it in the Custom Dictionaries dialog before it works.
Before editing your VBA macros, ensure you have the exact file path to your custom dictionary (.dic) file and back up your current Word document containing the macro code.
Add and Activate the Dictionary Directly Without ClearAll
Skip clearing all custom dictionaries to prevent Word from unlinking the active dictionary functionality, and simply assign the new dictionary directly in the Document_Open event.
The CustomDictionaries.ClearAll method can sometimes detach Word's internal spell-check engine from recognizing newly added dictionaries programmatically. By removing this command, the new dictionary integrates seamlessly.
Press Alt + F11 in Word to open the Visual Basic for Applications (VBA) editor, and locate your Document_Open event.
Find and delete or comment out the line that says 'Application.CustomDictionaries.ClearAll'.
Add your dictionary explicitly using the syntax: Set dicCustom = Application.CustomDictionaries.Add("C:\Path\To\Your.dic").
Force Word to use it as the default by adding: Application.CustomDictionaries.ActiveCustomDictionary = dicCustom.
Save your macro, close the editor, and reopen the document. Type a deliberate spelling error to verify that the custom dictionary is actively checking spelling.

Explicitly Assign the Dictionary Object After ClearAll
If your workflow strictly requires clearing all custom dictionaries first, you must capture the returned dictionary object and explicitly set it as the active default.
Try WPS Office for Seamless Word Processing
Dealing with complex VBA macro issues and dictionary bindings in Microsoft Word can disrupt your workflow. WPS Office offers a free, lightweight, and highly compatible alternative with an intuitive interface, making document creation, proofing, and editing straightforward and stress-free.

Frequently Asked Questions
Why does CustomDictionaries.ClearAll stop Word from using my new dictionary?
Using ClearAll removes all references to custom dictionaries in Word's registry and application settings. Sometimes, adding a new dictionary immediately after a ClearAll command fails to trigger Word's internal spell-check engine to actively use it until the dictionary list is manually refreshed in the Options menu.
How do I manually check my active custom dictionary in Word?
Go to File > Options > Proofing, and click on 'Custom Dictionaries'. Here you can see which dictionaries are currently loaded, verify the file paths, and ensure the checkbox next to your custom dictionary is selected.
What is the correct VBA syntax to add a custom dictionary?
You should use the Add method combined with the full file path. The standard syntax is: Application.CustomDictionaries.Add(FileName:="C:\YourDirectory\YourDictionary.dic").
Does WPS Office support VBA macros?
Yes, WPS Office supports macros (WPS Macro) and provides an environment similar to VBA, though highly specific Microsoft Office object model scripts may require minor adjustments depending on the functions used.




