Load Dictionary and Refresh ActiveDocument

K

krish

Hello all,

We are trying to add a custom dictionary in Word and need the
ActiveDocument to be updated with the newly added dictionary. Here's
what I mean:

Using this code:
With CustomDictionaries
.ClearAll
.Add( _
"C:\Documents and Settings\goundarn\Application Data
\Microsoft\Proof\CUSTOM.DIC" _
).LanguageSpecific = False
.Add("C:\Documents and Settings\goundarn\Desktop\test.dic").
_
LanguageSpecific = False
.ActiveCustomDictionary = CustomDictionaries.Item( _
"C:\Documents and Settings\goundarn\Application Data
\Microsoft\Proof\CUSTOM.DIC" _
)
End With


we are adding the dictionary to Word. Once we have added the
dictionary we need all the words in this dictionary to be
automatically updated if they have been marked for SpellChecking
before. Basically, we want the red underline of a word go away as
soon
as we add the dictionary to Word. The dictinary gets added
successfully but a word previously indicated as with spelling error
still shows this.

How can we apply the dictionary to refresh the document silently,
without the prompt to check spelling?

Thanks,
Neil.
 
J

Jay Freedman

Add these lines to the end of your macro:

ActiveDocument.SpellingChecked = False
ActiveDocument.CheckSpelling

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
K

krish

Hi Jay,

Thank you for your response. I really appreciate it.

I have already tried it, but that is not what I need. when calling
CheckSpelling word displays the CheckSpelling screen and I don't want
this prompt to come up.

All I am trying to do is that i want to add a dcitionary and
automatically remove the red underlines (wrong spelled word mark) from
the words that are in this dictionary. The dictionary is loaded
correctly but the words do still remain underlined.

Is there a way to refresh the whole document by applying this
dictionary?

Thanks,
Neil
 
D

Doug Robbins - Word MVP

I think that you need to set the LanguageID for the document so that it
matches the new dictionary

ActiveDocument.Range.LanguageID = wdFrench

for example.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - 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