【问题标题】:C# How to open doc/docx in Word application to a specified pageC#如何在Word应用程序中打开doc/docx到指定页面
【发布时间】:2016-10-15 03:47:12
【问题描述】:

我想使用 Word 将 doc/docx 文件打开到特定页面。 目前我使用 Process.Start() 并且无法弄清楚用什么来替换它来完成这项工作。

目的只是为了查看文档。我有一个基于 fileLocation/pageNumber 的数据库,此函数必须将文件直接打开到该页面。

我将不胜感激任何解决方案/替代方案。 谢谢!

【问题讨论】:

  • 你可以试试this library,可能会更容易。
  • 尝试使用谷歌文档来显示您的文件:<iframe src="http://docs.google.com/gview?url=http://www.domain.com/yourfile.docx&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>
  • Document.Goto 方法 msdn.microsoft.com/en-us/library/office/… 是我要走的路。
  • Ricardo:OP 在问题中说“使用 Word”。

标签: c# ms-word docx


【解决方案1】:

您考虑过使用互操作吗?如果是这样,请检查以下内容

how can we open a word file with specific page number in c sharp?

另一种解决方案是使用书签并在此处导航,如图所示

How do I use the Microsoft Word API and Bookmarks feature to programmatically open a Word document to a specific location?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多