程序如下:
String wordtest="test.doc";
boolean flag = false;
ActiveXComponent temp=new ActiveXComponent("Word.Application");
try{
temp.setProperty("Visible", new Variant(true));
Object docs=temp.getProperty("Documents").toDispatch();
Object doc = Dispatch.invoke(docs,"Open", Dispatch.Method,
new Object[]{wordtest,new Variant(false),
new Variant(true)}, new int[1]).toDispatch();
....后面省略了
目的就是想打开一个word文档
编译通过,运行错误,错误如下:
com.jacob.com.ComFailException: Invoke of: Open
Source: Microsoft Word请高手来指点一下,在网上找了很久也不知道原因另外再请教一个问题,我要打开word以后能够在word里编辑,并可以保存,用jacob能实现吗?
String wordtest="test.doc";
boolean flag = false;
ActiveXComponent temp=new ActiveXComponent("Word.Application");
try{
temp.setProperty("Visible", new Variant(true));
Object docs=temp.getProperty("Documents").toDispatch();
Object doc = Dispatch.invoke(docs,"Open", Dispatch.Method,
new Object[]{wordtest,new Variant(false),
new Variant(true)}, new int[1]).toDispatch();
....后面省略了
目的就是想打开一个word文档
编译通过,运行错误,错误如下:
com.jacob.com.ComFailException: Invoke of: Open
Source: Microsoft Word请高手来指点一下,在网上找了很久也不知道原因另外再请教一个问题,我要打开word以后能够在word里编辑,并可以保存,用jacob能实现吗?
http://deathmaster.tianyablog.com/blogger/view_blog.asp?BlogName=deathmaster