PDA

View Full Version : Dictionary Active



danvanf
10-06-2008, 05:04 PM
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

Demosthine
10-06-2008, 09:13 PM
Good Evening.

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


Application.CustomDictionaries.ActiveCustomDictionary.Name


Or set the Custom Dictionary using:


Application.CustomDictionaries.ActiveCustomDictionary = _
Application.CustomDictionaries.Items(CustomDictionaryName)


Take Care.
Scott

danvanf
10-07-2008, 05:30 AM
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

Demosthine
10-07-2008, 05:37 PM
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

danvanf
10-08-2008, 05:51 AM
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

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

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