求助,利用vbs将文档转换成pdf,本地没问题,到了服务器就有问题了

阳阳_阳阳 2019-02-22 11:10:26
求助大佬。
我写了一个vbs转换word,excel,ppt转换成pdf,在本地运行一点问题都没有,但是到了服务器上,就excel和ppt的转换有问题,利用java main方法执行vbs,excel和ppt的vbs文件调用后就没有结果了,很是迷茫。word的调用直接就好了。求大佬帮助解决一下,不胜感谢。服务器是windows
word的vbs
'path = createobject("Scripting.FileSystemObject").GetFile(Wscript.ScriptFullName).ParentFolder.Path

path = "E:\pdf\word"
Set word = CreateObject("Word.application")

Set docx = word.Documents.Open(path & "\" & "tmp.doc")

docx.SaveAs path & "\" & "tmp.pdf",17

docx.close(doNotSaveChanges)

word.Quit
set docx = nothing

Set word = nothing

excel的 vbs
'path = createobject("Scripting.FileSystemObject").GetFile(Wscript.ScriptFullName).ParentFolder.Path

path = "E:\pdf\word"
Set objArgs = WScript. Arguments
Set oExcel = CreateObject("Excel.Application")
Set oWb = oExcel.Workbooks.Open(path & "\" & "tmp.xls")
oWb.ExportAsFixedFormat xlTypePDF, path & "\" & "tmp.pdf", 1,1,1,1
oExcel.Visible = False
oExcel.quit
Set oWb = Nothing

ppt的vbs
'path = createobject("Scripting.FileSystemObject").GetFile(Wscript.ScriptFullName).ParentFolder.Path

path = "E:\pdf\word"
Set ppt = CreateObject("PowerPoint.application")

Set pptfile = ppt.Presentations.Open(path & "\" & "tmp.pptx",false,false,false)

pptfile.Saveas path & "\" & "tmp.pdf",32,false
ppt.Quit
Set pptfile= nothing


...全文
416 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
threenewbee 2019-02-23
  • 打赏
  • 举报
回复
这个代码是调用的Office,然后实现的转换,你的服务器是不是没有安装Office
阳阳_阳阳 2019-02-22
  • 打赏
  • 举报
回复
大佬呢 ,去哪里了

1,978

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 其他语言讨论
社区管理员
  • 其他语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧