tring sInputDoc = "E:\\中文.doc";
String sOutputDoc = "E:\\中文.doc";
String sOldText = "[label:import:1]";
boolean tVisible = true;
boolean tSaveOnExit = false;
ActiveXComponent oWord = new ActiveXComponent("Word.Application");
oWord.setProperty("Visible", new Variant(tVisible));
Object oDocuments = oWord.getProperty("Documents").toDispatch();---》运行到这里就异常了!!!!异常信息:出来什么问题了?怎么解决?
Caused by: com.jacob.com.ComFailException: A COM exception has been encountered:
At Invoke of: Documents
Description: An unknown COM error has occured.
at com.jacob.com.Dispatch.invokev(Native Method)
at com.jacob.activeX.ActiveXComponent.getProperty(ActiveXComponent.java)
at writeWord.Word.<clinit>(Word.java:28)
... 1 more