I need to start MS Word from command line. Now, I pass these commands
/q /n /mFilePrintDefault /mFileExit to it. In this case, I need manually press "No" on "save yes/no" dialog at the end (to close Word). What commands need to pass, to skip this (without saving or with saving doc) and automatically close Word?
In Word, create a macro in Normal.dotm using this code:
Sub CloseWithoutSaving() ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges Application.Quit End Sub
Then pass /q /n /mFilePrintDefault /mCloseWithoutSaving
I assume you are trying to print the document from the command line. You might want to do it the same way MS does it with right-click print. You can see details on this here: