如何保存从 PyUNO 编辑的文档?
我现在已成功打开 Word 97-2003 (.doc) 文档并通过 Python 对其进行编辑。但我该如何保存它呢?
我总是得到:
Traceback (most recent call last):
File "office.py", line 55, in <module>
model.storeToUrl('file:///c:/temp/out.doc', ())
AttributeError: storeToUrl
(相关问题。)
属性应该是什么?
然后我该如何关闭该文档?
I have now succeeded in opening a Word 97-2003 (.doc) document and edited it from Python. But how do I save it?
I always get:
Traceback (most recent call last):
File "office.py", line 55, in <module>
model.storeToUrl('file:///c:/temp/out.doc', ())
AttributeError: storeToUrl
What should the attributes be?
And how do I then close the document?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
另一个答案网上到处都是,而且很混乱。在一些例子中,model是TEXT对象,storeToURL()和dispose()是document对象的方法,这里是另一种实现。
The other answer is all over the net, and is very confusing. In some examples, model is the TEXT object, storeToURL() and dispose() are methods of the document object, here is another implementation.
请注意“URL”全部大写,在我的原始代码中它拼写错误,例如“Url”。
Note the all caps on "URL", in my original code it was spelled wrong, like "Url".