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调用过程中得到结果呢求救大虾!!!!!!!!!
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调用过程中得到结果呢求救大虾!!!!!!!!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货