I try to read a word document as follows:

          
          app = win32com.client.Dispatch('Word.Application')
doc = app.Documents.Open('D:\myfile.doc')
print doc.Content.Text

I receive the following error:

raceback (most recent call last):
  File "D:\projects\Myself\MySVD\src\ReadWord.py", line 11, in <module>
    print doc.Content.Text
  File "D:\Softwares\Python27\lib\encodings\cp1252.py", line 12, in encode
    return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode character u'\uf06d' in 
position 4397: character maps to <undefined>

How can I fix the problem. Thanks.


_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to