oodocx icon indicating copy to clipboard operation
oodocx copied to clipboard

Latest refactor causes error when opening doc in word

Open ajmirsky opened this issue 12 years ago • 3 comments

Not sure if you intended you latest commit (with refactoring) for consumption but I'm running into an error when opening up the document in MS Word:

latest

ajmirsky avatar Dec 30 '13 18:12 ajmirsky

What code did you run to create that document? Is the same code working for the previous commit?

etfre avatar Dec 30 '13 18:12 etfre

i was using a branch based on a fork from novemeber. but tracked down the commit that seems to have caused the problem.

i've been using the same code to test:

from oodocx import oodocx
d = oodocx.Docx()
p = oodocx.paragraph('a new paragraph')
b = d.get_body()
b.append(p)
d.save(r'basicexample.docx')

commit 2c2d0269b5f267067072afa3880683222c38b119 seems to be causing the problem. before that commit (2bd8e4e7a) the document opens with no problem.

ajmirsky avatar Dec 30 '13 19:12 ajmirsky

I'm not sure whether or not this is a separate issue, but I'd been getting a strange import related error. I removed the from oodocx import write_files in helper_functions.py and that seems to have solved it.

As for the error Word is having opening an oodocx created file, I haven't been able to reproduce that using the latest commit. If you're running the above code and not getting a deprecation warning from d.get_body(), then I'd guess that you're using an old, bugged version. Try running it with the latest commit and let me know if you're having the same issue.

etfre avatar Dec 30 '13 20:12 etfre