简体   繁体   English

C#如何在Word应用程序中打开doc / docx到指定页面

[英]C# How to open doc/docx in Word application to a specified page

I want to open a doc/docx file to a specific page using Word. 我想使用Word将doc / docx文件打开到特定页面。 Currently I use Process.Start() and can't figure it out with what to replace it for this job. 目前,我使用Process.Start(),无法用替换该作业的内容弄清楚。

The purpose is just for viewing the document. 目的只是为了查看文档。 I have a database based on fileLocation/pageNumber and this function must open the file directly to that page. 我有一个基于fileLocation / pageNumber的数据库,此功能必须直接将文件打开到该页面。

I would appreciate any solution/alternative. 我将不胜感激任何解决方案/替代。 Thank you! 谢谢!

Have you concidered workinig with interop? 您考虑过与互操作性工作吗? If so check the following 如果是这样,请检查以下内容

how can we open a word file with specific page number in c sharp? 如何在c Sharp中打开具有特定页码的Word文件?

Another solution would be to use a bookmark and navigate there as show in 另一种解决方案是使用书签并在其中导航,如

How do I use the Microsoft Word API and Bookmarks feature to programmatically open a Word document to a specific location? 如何使用Microsoft Word API和书签功能以编程方式将Word文档打开到特定位置?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM