Consulting

Results 1 to 5 of 5

Thread: Dictionary Active

  1. #1

    Question Dictionary Active

    I am attempting to figure out if a Dictionary listed in the CustomDictionaries object is selected. I can tell if it's not there, but can't figure out if it's checked.

    So I'm doing this
    For Each dicLoop In CustomDictionaries
    If Mid(dicLoop.Name, 1, 6) = "Select" Then
    CustomDictionaryFound = True
    End If
    Next dicLoop
    My application currently has 4 possible custom dictionaries, whose filenames all start with "Select", so the above code will tell me if any of the 4 are installed, but not checked. How do I tell which of the 4 dictionaries are currently active.

    Thanks,
    Dan

  2. #2

    ActiveCustomDictionary

    Good Evening.

    You should be able to tell which Custom Dictionary is active using:

    [VBA]
    Application.CustomDictionaries.ActiveCustomDictionary.Name
    [/VBA]

    Or set the Custom Dictionary using:

    [VBA]
    Application.CustomDictionaries.ActiveCustomDictionary = _
    Application.CustomDictionaries.Items(CustomDictionaryName)
    [/VBA]

    Take Care.
    Scott

  3. #3
    Thanks for the reply, that seems to return the Default Custom Dictionary, or the Custom Dictionary which will receive new words.

    It doesn't change as I loop through the CustomDictionaries object. I will never want my custom dictionaries set as default. I very much need to know if the are active, not just installed.

    Thanks,
    Dan

  4. #4

    Sorry...

    Hey Dan.

    I'm not quite following what you're trying to do then. Would your code and dictionaries so that I can check it out? That should help me answer it better.

    Scott

  5. #5
    Hi, Sure I can try to explain it better...
    So I have 5 possible Dictionaries that can be used, Named SelectLarge.Dic, Select2007.dic, SelectSmall.dic, SelectLite.Dic are in one set. SelectCustom.Dic is the other set. I need to make sure there is at least one dictionary selected from the first set, and that SelectCustom.Dic is installed. Right now the code looks like this

    [vba] Dim dicLoop As Dictionary
    Dim CustomDictionaryFound As Boolean
    Dim StandardDictionaryFound As Boolean
    CustomDictionaryFound = False
    StandardDictionaryFound = False
    For Each dicLoop In CustomDictionaries
    If Mid(dicLoop.Name, 1, 6) = "Select" Then
    If Mid(dicLoop.Name, 1, 12) = "SelectCustom" Then
    CustomDictionaryFound = True
    Else
    StandardDictionaryFound = True
    End If
    End If
    Next dicLoop
    If (CustomDictionaryFound = False) Or (StandardDictionaryFound = False) Then
    'Let the user know what's not found
    End IF[/vba]

    The above code will tell me if a Dictionary is in the Dictionary Collection, but will not tell me if that Dictionary is an active Dictionary. Attached(hopefully) is an image of the installed dictionaries, notice that SelectSmall.dic is not checked. So it's in the Collection, but not an active dictionary, and my code above will not figure that out. (It will mark both as True)

    FYI the attached image only shows one dictionary from the first set of 4, it's possible for a user to have all 4 in thier collection, only one from the first set should be selected as active at any time. (my code doesn't go that far yet since I can't figure out if one is selected.

    Thanks for the assistance!
    Dan

Posting Permissions

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