J
Julian Ladbury
I want to create and add a Custom Dictionary when my document opens, then
delete it when it closes. All works fine in Word XP and 2003, but not in 2007
and 2010 beta.
This is the code I have used to investigate the problem I have found:
' dictionary is created before this bit of code runs
Dim dictionaryName As String
dictionaryName = "C:\Documents and Settings\Lenny\Application
Data\Microsoft\UProof\Test.dic" ' Word 2007, Windows XP
' "C:\Documents and Settings\Lenny\Application
Data\Microsoft\Proof\Test.dic" ' Word XP or 2003, Windows XP
CustomDictionaries.Add dictionaryName
CustomDictionaries(dictionaryName).Delete
Kill dictionaryName
In Word XP and Word 2003, all works as expected. By the time the code
finishes, there is no trace of the dictionary in the list at Tools > Options
In Word 2007 and Word 2010 beta the custom dictionary remains in the list in
Word Options > Proofing > Custom Dictionaries, albeit unchecked.
I have stepped through the code and find that in all versions the dictionary
becomes unchecked in the list after the
'CustomDictionaries(dictionaryName).Delete' statement. in In Word XP and 2003
it is removed from the list after the 'Kill dictionaryName' statement, but
that is not the case with 2007 or 2010 beta.
delete it when it closes. All works fine in Word XP and 2003, but not in 2007
and 2010 beta.
This is the code I have used to investigate the problem I have found:
' dictionary is created before this bit of code runs
Dim dictionaryName As String
dictionaryName = "C:\Documents and Settings\Lenny\Application
Data\Microsoft\UProof\Test.dic" ' Word 2007, Windows XP
' "C:\Documents and Settings\Lenny\Application
Data\Microsoft\Proof\Test.dic" ' Word XP or 2003, Windows XP
CustomDictionaries.Add dictionaryName
CustomDictionaries(dictionaryName).Delete
Kill dictionaryName
In Word XP and Word 2003, all works as expected. By the time the code
finishes, there is no trace of the dictionary in the list at Tools > Options
Spelling and Grammar > Custom Dictionaries.
In Word 2007 and Word 2010 beta the custom dictionary remains in the list in
Word Options > Proofing > Custom Dictionaries, albeit unchecked.
I have stepped through the code and find that in all versions the dictionary
becomes unchecked in the list after the
'CustomDictionaries(dictionaryName).Delete' statement. in In Word XP and 2003
it is removed from the list after the 'Kill dictionaryName' statement, but
that is not the case with 2007 or 2010 beta.