Set Default Dictionary Per Document

P

Patrick York

Hi,

Can anyone tell me if it is possible to have Word 2007 select a default
custom dictionary based on the current document? When I am working on a
technical document, I wish the right-click on unknown words to add to one
dictionary, but when I am writing a personal letter, I want it to add to a
different dictionary.

If is is not possible via the user interface, might it be possible by using
Visual Basic?

Any help would be most appreciated.

Best wishes, Patrick
 
G

Graham Mayor

If you add the technical dictionary to your list of custom dictionaries in
Word Options > Proofing > Custom Dictionaries and make a note of the path
to this and any other custom dictionaries you might be using, then you can
switch the default using the following macro substituting the paths you have
noted in the macro.

If you want the spellings from both (or all) dictionaries to be available
then add the extra dictionaries in the IF and Else sections as appropriate
in the format .Add "C:\path\dictionary name.DIC"

Dim sDic As String
sDic = MsgBox("Use technical dictionary?", vbYesNo, "Custom Dictionaries")
With CustomDictionaries
.ClearAll
If sDic = vbYes Then 'add the technical dictionary and make it default
.Add "C:\path\Technical.DIC"
.ActiveCustomDictionary = .Item( _
"C:\path\Technical.DIC")
Else 'add the personal dictionary and make it default
.Add "C:\path\Custom.DIC"
.ActiveCustomDictionary = .Item( _
"C:\path\Custom.DIC")
End If
End With

http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top