用jacob word文档转PDF时报VariantChangeType failed
错误:com.jacob.com.ComFailException: VariantChangeType failed
at com.jacob.com.Variant.toVariantDispatch(Native Method)
at com.jacob.com.Variant.toDispatch(Variant.java:1999)
at com.sysway.DocToPic.doc2picServiceImpl.createPDF(doc2picServiceImpl.java:73)
at com.sysway.DocToPic.doc2picServiceImpl.PicAddree(doc2picServiceImpl.java:202)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.xfire.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:59)
at org.codehaus.xfire.service.invoker.ObjectInvoker.invoke(ObjectInvoker.java:45)
代码:
ActiveXComponent app=ActiveXComponent.createNewInstance("Word.Application");//启动ActiveX
Dispatch docs=app.getProperty("Documents").toDispatch();
System.out.println("打开文档..." + FilePath);
app.setProperty("Visible", false);
Dispatch doc=Dispatch.call(docs, "Open",FilePath).toDispatch();
求解决!!!!!始终打开word时报错。在我电脑上能运行,就是放到windos Server 2008 r2上时就报这个错!求赐教呀 大虾们!!!! --------------------编程问答-------------------- --------------------编程问答-------------------- 求追问!!!! --------------------编程问答-------------------- 同问~
在2003下,测试正常, 在2008,报VariantChangeType failed错!
Dispatch.call(docs, "Open",FilePath) 这句的返回值是:null
不知道为什么? --------------------编程问答-------------------- http://blog.csdn.net/zcmssd/article/details/7443502
Windows 2008 Server x64
Please make this folder.
C:\Windows\SysWOW64\config\systemprofile\Desktop
?Windows 2008 Server x86
Please make this folder.
C:\Windows\System32\config\systemprofile\Desktop
补充:Java , Java相关