Microsoft KB Archive/292108

From BetaArchive Wiki
Knowledge Base


GetSpellingSuggestions method does not list non-English language suggestions in Word

Article ID: 292108

Article Last Modified on 1/31/2007



APPLIES TO

  • Microsoft Office Word 2003
  • Microsoft Word 2002 Standard Edition



This article was previously published under Q292108


SYMPTOMS

Microsoft Office Word produces a list of suggestions in English, even though you are expecting suggestions in a language other than English. This can occur in the following situation:

  • The main dictionary that you specified is in a language other than English.
  • You use the GetSpellingSuggestions() method to produce a list of suggested correct spellings for a word that the spell checker does not recognize.


CAUSE

The HrGetSpellingSuggestions method, which is called by the GetSpellingSuggestion method, causes the mainDictionary parameter to be nil. As a result, the English language dictionary is used by default.

WORKAROUND

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

290140 How to run the sample code for the Office XP programs from Knowledge Base articles


To work around this problem, insert a reference to a valid custom dictionary before the reference to the main dictionary. To do this, follow this steps in the following example:

  1. Press ALT+F11 to open the Visual Basic Editor.
  2. On the Insert menu, click Module.
  3. In the Module window, type the following procedure:

    Sub FrenchSuggestions()
    
       Dim sug As SpellingSuggestion
       Dim dict As String
       Dim Msg As String
    
       dict = "French (France)"
    
       For Each sug In GetSpellingSuggestions(Word:="dixx", _ 
          CustomDictionary:="custom.dic", MainDictionary:=dict)
             Msg = Msg & sug.Name & vbCrLf
       Next
    
       MsgBox Msg
    
    End Sub
                        
  4. On the Run menu, click Run Sub/User Form.

    The message box contains the French word "dix" as a spelling suggestion.


STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.


Additional query words: VBE VBA WD2002 WD2003

Keywords: kbbug kbpending KB292108