使用打开 xml 文件格式 API 打开 word 2003 (doc) 文件
我想知道是否可以使用 open xml 文件格式 API 打开 Open word 2003 (doc) 文件?就像 Office 2007 一样。
我有一个 Windows 服务,我试图通过它打开和编辑 doc 文件,但遇到很多问题。我已经发布了有关该问题的问题 此处但没有得到答复。
经过大量谷歌搜索后,我发现此页面介绍了微软办公自动化对服务器端代码的建议。微软建议办公自动化不应在服务器端代码中实现,因为办公应用程序是为交互式客户端工作站而设计的。此页面不说明是否可能以及如何使用开放 xml 格式 API 打开文档文件。
基本上,我想要一个 Windows 服务,它将 doc 文件作为输入,打开它,编辑它并保存它。如何实现这一目标?
我的开发环境:C#、.net 2.0框架、Windows Vista、Office 2003
I would like to know whether its possible to open Open word 2003 (doc) file using open xml file format API? like office 2007.
I have one windows service through which I am trying to open and edit doc files but getting lot of problems.I have posted question regarding that problem here but got no answer.
After lot of googling, I came across this page which tells about microsoft recommendations of Office automation on server-side code. Microsoft suggests that office automation should not be implemented in server-side code,as office applications are made for interactive client workstations. This page does not tell if its possible and how to open doc files using open xml format API.
Basically, I want one windows service which will take doc file as an input, open it, edit it and save it. How to achieve this?
My development enviornment : C#, .net 2.0 framework, Windows Vista, Office 2003
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您可能错过了 Office 互操作的要点。使用 Office 互操作基本上意味着您与正在运行的 Microsoft Office Word/Excel 进程进行通信,并以定义的方式操作文档/电子表格。如果您使用 Office interop,则无需直接修改 Word 文档本身。
如果您希望在没有 Microsoft Office 的情况下直接修改 Office .doc 文档,那么您最好的选择是 Google 寻找一个可以直接为您操作 .doc 的库,尽管这些库往往存在相当多的错误,并且它们在哪里不是越野车,而是很贵。
编辑:如果您询问是否可以使用 Office 2007 互操作来操作 .doc 文件,那么答案是肯定的。
I think you might be missing the point of Office interop. Using Office interop basically means you communicate with a running Microsoft Office Word/Excel process and manipulate a document/spreadsheet in a defined manner. There is no need to directly modify a word document itself if you use Office interop.
If you wish to modify an Office .doc document directly without the presence of Microsoft Office, then your best bet would be to Google for a library that will directly manipulate .doc for you, although these libraries tend to be fairly buggy, and where they aren't buggy, they're expensive.
EDIT: If you're asking whether or not you can use Office 2007 interop to manipulate a .doc file, then the answer is yes.
你不能。微软从Word 2007开始引入office open xml标准。Word 2003使用二进制格式。
You can't. Microsoft introduced office open xml standard from Word 2007. Word 2003 uses binary format.