PDA

View Full Version : Determine active custom dictionaries



smallken
08-22-2019, 05:01 PM
I have 4 custom spelling dictionaries Dict1, Dict2, Dict3 and Dict4.
Dict2 and Dict3 are inactive and have clear tick boxes alongside their entries in the Custom Dictionary dialog box (File > Options > Proofing > Custom Dictionaries).
I am trying to determine what custom dictionaries are activate.


Sub CustomDictionaries()
Dim D As Dictionary
Dim k As Long
Dim s As String

' **** method 1 ****
s = ""
For Each D In Application.CustomDictionaries
s = s & D.Name & vbCrLf
Next D
MsgBox s

' **** method 2 ****
s = ""
For k = 1 To Application.CustomDictionaries.Count
s = s & Application.CustomDictionaries(k).Name & vbCrLf
Next k
MsgBox s

End Sub

Method 1 lists all active and inactive custom dictionaries:
Dict1
Dict2
Dict3
Dict4

Method 2. The Count property should give the number of items in the collection. Instead it gives the number of active custom dictionaries. The result is therefore:
Dict1
Dict2

What I want is a list of only the active dictionaries which in the example is Dict1 and Dict4.

Artik
08-24-2019, 02:54 PM
Something is probably wrong with your Word. For me, both methods return only active dictionaries.

Artik

smallken
08-24-2019, 06:56 PM
I have been running the macro in Word2010. When I run it in Word2016 the results return just the active custom dictionaries as Artik found. However, it raises another issue. How to I find inactive custom dictionaries in 2016?

Artik
08-25-2019, 12:58 AM
I admit that I checked the code on version 365.
As for inactive dictionaries, I'm afraid the task may not be easy. I think you should look into the Registry. I found something here: \HKEY_CURRENT_USER\Software\Microsoft\Shared Tools\Proofing Tools\1.0\Custom Dictionaries

Artik

smallken
08-25-2019, 08:29 PM
Thanks for your comments. There seems to be quite a few differences in spell checking between 2010 and 2016. So much for compatibility between versions.