0
votes

I have a vbs script to open word document and save it to txt file. But it works with the dialogue box open. Is it possible to read word doc file and save it to txt file without opening dialogue?

strFile = "C:\test.doc"

Set objWord = WScript.CreateObject("Word.Application")

objWord.Documents.Open strFile

objWord.ActiveDocument.SaveAs strFile&".txt", 2

1

1 Answers

1
votes

Use the DisplayAlerts Property to control the alerts. Something like:

Application.DisplayAlerts = wdAlertsNone

(assumes a properly defined Const wdAlertsNone).