Consulting

Results 1 to 5 of 5

Thread: Determine active custom dictionaries

  1. #1
    VBAX Regular
    Joined
    Jun 2011
    Posts
    30
    Location

    Determine active custom dictionaries

    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.

  2. #2
    VBAX Tutor
    Joined
    Dec 2008
    Posts
    277
    Location
    Something is probably wrong with your Word. For me, both methods return only active dictionaries.

    Artik

  3. #3
    VBAX Regular
    Joined
    Jun 2011
    Posts
    30
    Location
    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?

  4. #4
    VBAX Tutor
    Joined
    Dec 2008
    Posts
    277
    Location
    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

  5. #5
    VBAX Regular
    Joined
    Jun 2011
    Posts
    30
    Location
    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •