开发者

How to open Word document from commandline on certain page or similar

I want from my java code to open word document. But not just to open the document but also to open on exact page or paragraph.

Any ideas or guidelines?

开发者_运维知识库

NEWS! I found out that I can put bookmarks on specified places in the document ant then when I open the document I can go to them with Macro. Also Macro can be specified when you open document. Like this:

String[] cmd  = {"cmd","/c","c:\\Program Files (x86)\\Microsoft Office\\Office12\\WINWORD.exe","/mOpenPage","c:\\Navodilo.doc"};            
Process proc = Runtime.getRuntime().exec(cmd);  

Its ok only how to open the document with specified Macro /mOpenPage without to specify path to winword.exe, or you see some work-around?

Thanks in advance!


If it is possible to open Word document on a specific page from command line, then you can use Runtime.exec() to execute that.


you can open word-document in your application by using Apache POI API you can open all office product by using POI.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜