Has anybody got any thoughts about checking words against foreign dictionaries.
For Example, suppose the word is "Wurst" in German, I want that to return True, but "Vurst" to return false
I believe DoCmd.RunCommand acCmdSpelling only checks in the native language.
In addition, the spell checker only seems to list 3 languages (all various varieties of English, French & Spanish), but not German
Thanks
Phil
What if you downloaded databases of words in different languages? You could DLookUp to that to determine if the word is part of that language.
7 2370 - This is Theory (Air Code), Phil. I know that it works for English and I can only assume that it works for other Languages assuming you have the appropriate Dictionary installed.
- The idea is to:
- Create an Instance of Excel.
- Change the Language used for Spell Checking (DictLang Property).
- Execute the CheckSpelling() Method of the newly created Excel Application Object against the Word.
- Code Definition:
- Dim appExcel As Excel.Application
-
-
Set appExcel = New Excel.Application
-
-
With appExcel
-
.Visible = False
-
.SpellingOptions.DictLang = 1033 'Works for English
-
Debug.Print IIf(.CheckSpelling(Word:="Vurst"), "Valid", "NOT Valid")
-
End With
-
-
appExcel.Quit
-
Set appExcel = Nothing
-
- Options for German Language (Value of DictLang):
- 'German - 1031
-
'GermanAustria - 3079
-
'GermanLiechtenstein - 5127
-
'GermanLuxembourg - 4103
-
- Again, this is only Air Code and I am assuming that you will have to have the Custom Dictionary (*.dic) installed.
- Assuming all works out well, False should appear in the Immediate Window.
- Good Luck with your Project.
Thank for that. I have modified the code to -
Function CheckSpelling2(InputStr As String, DictionaryLanguage As Long)
-
' DictionaryLanguage = 2057 for UK Englisg, 1031 for German German
-
'?checkspelling2("deutch", 1031) ' This gives an error that the language is not installed
-
'?checkspelling2("dog", 2057) ' This works
-
-
Dim Result As Boolean
-
Dim Marker As Integer
-
On Error GoTo CheckSpelling2_Err
-
-
Dim appExcel As Excel.Application
-
-
Set appExcel = New Excel.Application
-
-
With appExcel
-
.Visible = False
-
Marker = 1
-
.SpellingOptions.DictLang = DictionaryLanguage 'Works for English
-
Marker = 2
-
Result = .CheckSpelling(InputStr)
-
CheckSpelling2_Exit:
-
.DisplayAlerts = False
-
.Quit
-
Set appExcel = Nothing
-
End With
-
-
Debug.Print Result
-
-
Exit Function
-
-
CheckSpelling2_Err:
-
If Err = 1004 Then
-
MsgBox "Neccessary language is not installed", vbCritical
-
Else
-
LogError Err, Err.Description, "CheckSpelling2", Marker
-
End If
-
-
Resume CheckSpelling2_Exit
-
-
End Function
-
The LogError is just a routine to save any unhandled errors to a table.
It works perfectly for English, bu in spite of having installed the German language pack, I get the Error 1004 coming up.
Any forther thought would be appreciated
Phil
Just found another problem. which I thought the .DisplayAlerts = False would cure, and that is that I get numerous messages "Do you want to save Sheet 1?
Phil
Not really sure on this one, Phil. You could research the 2nd Argument of the CheckSpelling() Method where you can optionally set the Custom Dictionary to use. - Application.CheckSpelling(Word As String,[CustomDictionary],[IgnoreUppercase]) As Boolean
Don't think that that is a runner. As far as I know, the Custom Dictionary is your personal dictionary to which you can add your own words.
I think spell check checks the standard directory and then the custom directory to see if a word exists.
Phil
What if you downloaded databases of words in different languages? You could DLookUp to that to determine if the word is part of that language.
That sounds feasible, Rabbit.
I have just downloaded about 1.2 million German words, and it checks if a word exists in about .5 seconds.
I shall play with this further.
Many thanks
Phil
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Irishmaninusa |
last post by:
Hello,
I have a form which has a check box on it and the name of the checkbox in
the source code is
"Übermitteln Sie mir bitte folgende Informationen über den ValuePark:"
When I submit this...
|
by: Lady_A |
last post by:
Hi,
I have an XP SP2, .net framework 1.1 SP1.
An html/css interface using jscripts in which I create ActiveX objects and
present a dialog using the appropriate language set by the user on that...
|
by: Dave |
last post by:
Hi All,
I have a VS.NET 2003 solution that uses several setup projects to package various components and applications into MSI files. I need to provide foreign language support for 5-6 languages...
|
by: jaekim |
last post by:
Visual .NET c# design view is showing "?????" for all the Korean
characters in design view.
In code view, it looks okay.
Did anybody have this kind of problem with foreign characters?
|
by: Calvin Lai |
last post by:
Hi all,
I have a serious problem with the application I am developing. The language
I used are mainly English, and some Chinese. (But I guess this problem
happens accross different language).
...
|
by: Krich |
last post by:
I have text file contains word in English language and in
foreign language and I include this text file as embedded
resource in
my project. VB.NET editor can display the foreign langue
of this...
|
by: Dave |
last post by:
Hi All,
Don't know if anyone has ever come across this but was just wondering.
Am programming something to be used in a number of countires and was
asking regarding Fonts. I have a page to...
|
by: mohammedsk |
last post by:
Hi,
I am trying to save information into MySQL using PHP. The data I am saving is in Arabic language.
The database table will show some "???" or other characters.
If I insert the text directly...
|
by: Fineen |
last post by:
I have been interested in learning Italian for quite a long time and I have finally decided to take the plunge! I have found a good course consolidator voyages linguistiques angleterre , estudiar...
|
by: rosscos20 |
last post by:
I am creating a dual language website containing both English and Hebrew versions. The Hebrew javascript does not display in IE, the English works perfectly? How do I solve the problem?
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |