本帖最后由 会卖萌的大树 于 2014-8-31 08:49 编辑
查找了半天,自己写了这个,目前就只能把word转化为pdf,利用是word的另存为功能在接着试其他类型的文档- On Error Resume Next
- If WScript.Arguments.Count = 0 Then
- WScript.Echo "Usage :print2Pdf docPath pdfPath"
- WScript.Quit
- Else
- Dim oWord,objFile,docPath,pdfPath
- docPath = WScript.Arguments.Item(0)
- pdfPath = WScript.Arguments.Item(1)
- Set oWord = CreateObject("word.application")
- oWord.Visible=false
- Set objFile=oWord.Documents.open(docPath)
- objFile.SaveAs2 pdfPath,17
- objFile.Close
- oWord.Quit
- End If
复制代码
|