Re: Using MS Main Library in Access VBA



"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!)





.



Relevant Pages

  • Re: Using MS Main Library in Access VBA
    ... >>>combinations for those seven letters (I have been able to do this pretty ... >> to that is to place a string of characters in a textbox, ... >Function WordSpellCheck(WordToCheck As String) As Boolean ... >instantiate Word as a module-level object, ...
    (microsoft.public.access.formscoding)
  • Re: A red tide in the affairs of men.
    ... >>system after the keystrokes in vi for switching two characters. ... those two letters had many more existing interpretations than that. ... (That's the first conflict which came to mind when I first heard ... > (I think there should be a horror movie entitled "The Letters From Microsoft".) ...
    (alt.sysadmin.recovery)
  • Re: Using MS Main Library in Access VBA
    ... >involves inputting seven letters and then creating a table with all possible ... Is there a way to use the Microsoft main dictionary ... The Access "dictionary" is just the spell checking feature ... to that is to place a string of characters in a textbox, ...
    (microsoft.public.access.formscoding)
  • Re: Swap characters shortcut?
    ... other editors. ... I think the Microsoft people don't have whatever it is that ... > Is there a shortcut in Word 2002 to swap two characters? ...
    (microsoft.public.word.newusers)
  • Re: User Accounts
    ... Change the name of the account. ... hackers as a means of getting a foothold into your system. ... using all upper case or all lower case letters. ... It should contain at least eight characters. ...
    (microsoft.public.windowsxp.help_and_support)