首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

求救!java执行vbs如何得到返回结果

2012-03-21 
求救大虾!!!java执行vbs怎么得到返回结果Const WdDoNotSaveChanges 0Const wdFormatPDF 17Dim wdoDim

求救大虾!!!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有没有生成就知道是否转换成功

热点排行