日期:2014-05-20  浏览次数:20690 次

求救大虾!!!java执行vbs怎么得到返回结果
Const WdDoNotSaveChanges = 0
Const wdFormatPDF = 17
Dim wdo
Dim wdoc
On Error Resume Next
Set wdo = CreateObject("Word.Application")
sDocFile = "E:/wordtopdf/test2.docx"
Set wdoc = wdo.Documents.Open(sDocFile)
wdoc.SaveAs "E:/wordtopdf/test.pdf", wdFormatPDF
wdoc.Close WdDoNotSaveChanges
wdo.Quit WdDoNotSaveChanges
Set wdo = Nothing
If Err <> 0 Then
  WScript.Echo "An error occurred: " & Err.Description
Else
  WScript.Echo "Success! "
End If 

以上是vbs脚本
我用java进行调用
Process process = Runtime.getRuntime().exec(cpCmd);
如果vbs在执行过程中发生异常,我如何在java调用过程中得到结果呢

求救大虾!!!!!!!!!

------解决方案--------------------
你也不需要知道返回值 判断pdf有没有生成就知道是否转换成功