打开 Word 文档
如何在 VB.NET 中打开 Word 文档。该文档是该程序的手册。
How do you open a word document in VB.NET. The document is a manual for the program.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何在 VB.NET 中打开 Word 文档。该文档是该程序的手册。
How do you open a word document in VB.NET. The document is a manual for the program.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
您需要调用
Process.Start(documentPath)
。You need to call
Process.Start(documentPath)
.您可以通过以下方式打开它:
不要忘记使用
Imports Microsoft.Office.Interop.Word
You open it by:
Don't forget to use
Imports Microsoft.Office.Interop.Word
使用
Process.Start
在适当的编辑器中启动 Word 文档。如果您有权访问程序集,则可以使用
Microsoft.Office.Interop.Word
命名空间在代码中操作 Word 文档,尽管这可能远不如 Excel 互操作那么简单,除非您制作非常简单的word文档。Use
Process.Start
to launch a Word document in the appropriate editor.If you have access to the assemblies, you can use the
Microsoft.Office.Interop.Word
namespace to manipulate Word documents in code, though this is probably nowhere near as trivial as Excel interop, unless you're making very simple word documents.Microsoft Web 浏览器控件可以显示 ActiveX 文档。该控件可以放置到 WinForms 或 WPF 应用程序中
Microsoft Word 是一个 ActiveX 文档提供程序。因此,您可以将 Microsoft Word 文档加载到 Web 浏览器控件中。 查看 VB.Net 2005 的示例
然后您就可以完全控制Microsoft Word 子窗口的。加载任何文档,调整窗口大小,更改可见性等,您甚至可以发送控制消息(宏)
其他一些SO参考:
The Microsoft Web Browser Control can display ActiveX documents. This control can be placed onto a WinForms or WPF application
Microsoft Word is a ActiveX document provider. So you can load Microsoft Word documents into the Web Browser control. See this example for VB.Net 2005
You then have total control of the Microsoft Word child window. Load any document, re-size window, change visibility etc, you can even send control messages (macros)
Some other SO references: