I'm trying to run Word from cscript witch is runned out from windows service under LOCAL SYSTEM account.
cscript is simple. Something like this:
Option Explicit
On Error Resume Next
SaveWordAsPDF
Sub SaveWordAsPDF()
Dim objWord
Dim objDocument
if WScript.Arguments.Count = 0 then
WScript.Echo "Missing parameters"
end if
Set objWord = CreateObject("Word.Application")
'objWord.Visible = True
objWord.WordBasic.DisableAutoMacros
Set objDocument = objWord.Documents.Open(WScript.Arguments.Item(0), 0, True)
WScript.Sleep 5000
objDocument.SaveAs WScript.Arguments.Item(1), 17
objDocument.Close FALSE
objWord.Quit
End Sub
I'm getting an error "Word could not create the work file. Check the Temp environment variable". All answers from this Automating MS Word in Server 2012 R2 topic doesn't help.
Word 2013 x64 Windows Server 2012 R2 x64.