View Single Post
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
gil gil is offline
external usenet poster
 
Posts: 112
Default Word2007 code to add or activate custom dictionaries?

Hi All,



I cannot get VBA code to add my 2003 Word dictionaries. The dictionaries are located at the same folder as the template attached to the document opened. I've tried the codes below to no avail.



They do not work when in normal.dotm nor when in an autoOpen in a 2003 attached template. They work in Word 2003 fine. They do not work when I put the dictionary in an easy to address folder location such as "c:\testFolder\custom201.dic".



If I go to Word 2007's "Button/ Options/ Proofing" and add them in one by one, they work. But I am trying to facilitate this for others who use the program I work on.



........

Sub macro41()

With CustomDictionaries

.ClearAll

With .Add(ActiveDocument.AttachedTemplate.Path & "\Custom201a.dic")

.LanguageSpecific = True

' .LanguageID = wdEnglishUS

End With

End With

End Sub

......



Sub macro42()

With CustomDictionaries

.ClearAll

With .Add("c:\testFolder\Custom201a.dic")

.LanguageSpecific = True

' .LanguageID = wdEnglishUS

End With

End With

End Sub

.......





---------------------------------------------

When the following code is run, the message box suggests all my dictionaries are there and working . but they are not.

......

For Each d In CustomDictionaries

MsgBox d.Name

' Shows names of all intended dictionaries

' even though they are not active

Next d

.........



On my very first file opening with Word 2007, the dictionaries seemed to be functioning fine, but not since then. ClearAll does work.



Any ideas?



tia

Gil Carter

TenSecondMedicalRecord