How can I do French and English Spell Checking using MS Word from Python
Pater Maximus
emayo at home.com
Tue Oct 19 20:48:08 EDT 2004
I have been knocking my brains out on this one. I just got it to work while
putting together a reply to you. That just goes to prove the
Shakespeare/typing monkeys paradigm works in Python too:)
I figured it out by using the "dot completion" in Delphi to discover that
.Selection.LanguageID was acceptable.
Here is the code from my program. I am new to Python so forgive bad idioms.
.
#Other stuff here...
msword = win32com.client.Dispatch("Word.Application")
msword.Selection.LanguageID=1036 # the 1036 should be the constant wdFrench
but I could not get it to run with it
for line in inputFile:
word = line.split(',')
if msword.CheckSpelling(word[1]):
print "!%s! OK!" % word[1]
continue
print "Misspelled" , line
#Other stuff here...
The line with LanguageID was the missing piece.
Question: Is there "dot completion" in any of the free Python editors?
Thanks for your reply.
More information about the Python-list
mailing list