我有一个vb脚本。它读取文本文件并创建Word文档。脚本如下。 我已经在任务计划程序中计划了工作。
错误:
D:\ ADDS \ vbscript.vbs(6,1)Microsoft Word:文档名称或路径无效。(D:\ ADDS \ ZCHECK_LOG.TMP)
D:这里是本地驱动器,并且D:\ ADDS \ ZCHECK_LOG.TMP存在。
dim objwd
dim mytest
set objwd = wscript.createobject("word.application")
objwd.visible=false
objwd.documents.add
objwd.selection.insertfile "D:\ADDS\ZCHECK_LOG.TMP","", false, false, false
With objwd.ActiveDocument.PageSetup
.Orientation = 1
.PageWidth = "11"
.PageHeight = "8.5"
.TopMargin = "1.5"
.BottomMargin = "1"
.LeftMargin = "1"
.RightMargin = "1"
End With
objwd.Selection.WholeStory
With objwd.Selection.Font
.Name = "Courier New"
.Size = "7.5"
.Bold = true
End With
objwd.activedocument.fields.unlink
objwd.selection.endkey
objwd.selection.delete 1
objwd.activedocument.showgrammaticalerrors = false
objwd.activedocument.showspellingerrors = false
objwd.activedocument.saveas "D:\ADDS\ZCHECKLOG_20180730160001.DOC"
objwd.documents.close
objwd.application.normaltemplate.saved = true
objwd.application.quit