none
GetSpellingSuggestion fails for some languages RRS feed

  • Question

  • We use ms word spell checker to get spelling suggestions in our application.
    It works fine most of the time, but we noticed problems with Portuguese
    (Portugal) language:

    many words (mostly with accented characters) don't get any suggestions when
    we use COM, but suggestions are present in Office Word opened document.

    The following vba snippet shows what code we try:

    Sub GetSuggestions() 
    
    Dim sug As SpellingSuggestion 
    Dim dict As String 
    Dim Msg As String 
    
    dict = "Portuguese (Portugal)" 
    
    For Each sug In GetSpellingSuggestions(Word:="verao", 
    CustomDictionary:="custom.dic", _ 
    MainDictionary:=dict) 
    
    Msg = Msg & sug.Name & vbCrLf 
    
    Next 
    
    MsgBox Msg 
    
    End Sub 




    This should give verão but GetSpellingSuggestions returns nothing. But if I
    put verai then GetSpellingSuggestions returns what expected. Attached png
    shows problematic words.

    Note that Portuguese (Brazill) does work fine.

    We also noticed problem with Italian dictionary when words are hyphenated.
    Problem is similar: OLE interface does not work.





    This problem appears only in word 2007.




    Monday, October 17, 2011 2:56 PM

Answers

  • Hi INickolodeon,

    If I don't specify a main dictionary, then GetSpellingSuggestions returns the result which is shown as below image. Please have a try.

    For Each sug In GetSpellingSuggestions(Word:="verao", CustomDictionary:="C:\Documents and Settings\Administrator\Application Data\Microsoft\UProof\custom.dic")
    

     

    If you have any concerns, please feel free to follow up.

    Have a nice day.

    Best regards


    Liliane Teng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Liliane Teng Tuesday, October 25, 2011 10:31 AM
    Wednesday, October 19, 2011 9:46 AM