Re: Using MS Main Library in Access VBA
- From: "Douglas J. Steele" <NOSPAM_djsteele@xxxxxxxxxxxxxxxxx>
- Date: Sun, 28 Aug 2005 14:11:02 -0400
"Marshall Barton" <marshbarton@xxxxxxxxxx> wrote in message
news:9gn3h153j2a3kmp4sli3og2qjnv9hfm7pr@xxxxxxxxxx
> Stuart Henry wrote:
>
>>I am trying to build an anagram utility for improving Scrabble skills. It
>>involves inputting seven letters and then creating a table with all
>>possible
>>combinations for those seven letters (I have been able to do this pretty
>>easily). I next want to check that table against a dictionary to find out
>>if
>>any of the combinations are actually words. Then I would like to write
>>the
>>actual words to another table. I don't see how to use the Microsoft main
>>dictionary for this. It looks like I have to create my own custom
>>dictionary, but I don't know how I would populate that with all the words
>>in
>>the English language. Is there a way to use the Microsoft main dictionary
>>for this purpose? Or does anyone else have any ideas?
>
>
> The Access "dictionary" is just the spell checking feature
> that's part of all the Office applications. One way to get
> to that is to place a string of characters in a textbox,
> give it the focus, select all the characters, then use
> DoCmd.Runcommand acCmdSpelling. That may cause problems in
> that you will get the spell check dialog box.
>
> You would probably be better off doing this project in Word
> where you can use the CheckSpelling method. Or you may want
> to explore using the Word Library or Automation to use that
> function from Access.
Function WordSpellCheck(WordToCheck As String) As Boolean
On Error GoTo Err_WordSpellCheck
Dim wd As Object
If Len(WordToCheck) > 0 Then
Set wd = CreateObject("Word.Application")
WordSpellCheck = wd.CheckSpelling(WordToCheck)
End If
End_WordSpellCheck:
If Not wd Is Nothing Then
wd.Quit
Set wd = Nothing
End If
Exit Function
Err_WordSpellCheck:
MsgBox Err.Description
Resume End_WordSpellCheck
End Function
Of course, to check a bunch of words, it would probably be better to
instantiate Word as a module-level object, rather than in the function.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
.
- Follow-Ups:
- Re: Using MS Main Library in Access VBA
- From: Marshall Barton
- Re: Using MS Main Library in Access VBA
- References:
- Using MS Main Library in Access VBA
- From: Stuart Henry
- Re: Using MS Main Library in Access VBA
- From: Marshall Barton
- Using MS Main Library in Access VBA
- Prev by Date: Re: max length when using me!listbox.additem
- Next by Date: Re: max length when using me!listbox.additem
- Previous by thread: Re: Using MS Main Library in Access VBA
- Next by thread: Re: Using MS Main Library in Access VBA
- Index(es):
Relevant Pages
|