Add Method (Dictionaries Collection)
Applies To
Dictionaries collection object.
Description
Adds the dictionary specified by FileName to the collection of active custom spelling dictionaries. If a file with the name specified by FileName doesn't exist, Word creates one.
Syntax
expression.Add(FileName)
expression Required. An expression that returns a Dictionaries object. Use the CustomDictionaries property to return the collection of custom spelling dictionaries.
FileName Required String. The string name of the dictionary file. If no path is specified in the string, the proofing tools path is used.
Remarks
The Dictionaries collection includes only the active custom spelling dictionaries. Dictionary objects that are derived from the Languages collection don't have an Add method. These include the Dictionary objects returned by the ActiveSpellingDictionary, ActiveGrammarDictionary, ActiveThesaurusDictionary, and ActiveHyphenationDictionary properties.
See Also
CustomDictionaries property.
Example
This example removes all dictionaries from the list of custom spelling dictionaries and creates a new custom dictionary file. The new dictionary is assigned to be the active custom dictionary, to which new words are automatically added.
With CustomDictionaries
.ClearAll
.Add FileName:= "C:\My Documents\MyCustom.dic"
.ActiveCustomDictionary = CustomDictionaries(1)
End With
This example creates a new custom dictionary and assigns it to a variable. The new custom dictionary is then set to be used for text that's marked as French (Canadian). Note that to run a spelling check for another language, you must have installed the proofing tools for that language.
Set myDictionary = CustomDictionaries.Add(FileName:="MyFrench.dic")
With myDictionary
.LanguageSpecific = True
.LanguageID = wdFrenchCanadian
End With