Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2005

Tip: Looking for answers? Try searching our database.

Add a word to (custom) dictionary

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrew Fiddian-Green - 01 Apr 2005 17:04 GMT
The Word Dictionary object  comes in two flavours: 1) "read only"
dictionaries (based on .lex files) and 2) "non read only" dictionaries
(based on .dic files).

Indeed in Word automation you can check if a dictionary is "read only" by
means of the respective ReadOnly property.

But -- here is the mystery -- even if Dictionary.ReadOnly = false, it seems
that there is absolutely nothing that you can actually do to write a new
word into the dictionary! (or delete an existing word from it)i.e. there are
no AddWord or DeleteWord methods...

Questions:

1. Am I right or am I wrong?
2. Is there a work around for adding words to a "non read only" dictionary?
3. If not, then why on earth does Microsoft bother to publish a totally
useless ReadOnly property??

Regards,
AndrewFG
Helmut Weber - 01 Apr 2005 19:03 GMT
Hi Andrew,

a user dictionary is nothing but an ordinary text-file.
It's faster to code it yourself then searching
for a ready to use VBA-method:

Add a word:

Open "c:\test\test.dic" For Append As #1
Write #1, trim(Selection.Words(1))
Close 1

Somewhat simplified, though.

Need help on deleting, checking whether already
in the dictionary?

Ask again.

Greetings from Bavaria, Germany

Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
Andrew Fiddian-Green - 04 Apr 2005 20:42 GMT
Yes, thanks, but I worked that out myself already.

Now, all I need to know is how to how to hook up to the custom dictionary
when using wordDocument.Range.SpellingErrors and
wordDocument.Range.GetSpellingSuggestions...

Regards,
AndrewFG

> Hi Andrew,
>
[quoted text clipped - 21 lines]
> Word XP, Win 98
> http://word.mvps.org/
Helmut Weber - 05 Apr 2005 15:09 GMT
Hi,

>Now, all I need to know is how to how to hook
>up to the custom dictionary

Maybe it's my English.
Do you wnat to now how to activate a custom dictionary?
CustomDictionaries.Add ("C:\dic\user.dic")
Doesn't matter whether activating it several times,
whithout deactivating it again.
Though I didn't find a straight way to deactivate
a custom dictionary, but only workaraounds.

Or are you looking for:

CustomDictionaries.Count
CustomDictionaries(1).name
CustomDictionaries(1).path

etc.

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.