Information générale
Catégorie:
COM/DCOM et OLE Automation
>>>Is there a way to retrieve the collection returned by Word.GetSpellingSuggestions("some-word") method?
>>
>>You need to traverse the collection and grab the data. My Advisor Answers piece in the July issue was about this. The key code you need is:
>>
>>oSuggestions = oWord.GetSpellingSuggestions("whatever")
>>FOR EACH oSuggestion in oSuggestions
>> * oSuggestion.Name contains this suggested spelling.
>>ENDFOR
>
>Thank you, Tamar. Unfortunately, I was (and am) getting a "server threw an exception" at the method call, although the spell checker works fine inside Word. Maybe there is something wrong with the Word setup in the PC where I tried this. I'll re-check this.
You need to open any document
oWord.Documents.Add()
Then >>oSuggestions = oWord.GetSpellingSuggestions("whatever")<< should work
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement