I'm trying to save a document from a software program after running a macro in a specified folder as a Word file that is read only and not displayed on the screen. I would expect the following to work but it is saving as the default .inv file generated by the program rather than changing to a Word file. Is there a better way to save as a .doc file? Word is also not closing afterward, so I changed the close code and then added "ActiveWindow.Close" to the original section of the macro after calling Invoice but it still doesn't close.
Sub Invoice()
Dim NewPath As String
NewPath = "m:\Invoices\"
ActiveDocument.SaveAs FileName:=NewPath & ActiveDocument.Name, FileFormat:=wdFormatDocument, ReadOnlyRecommended:=True
'ActiveDocument.Close
ActiveDocument.ActiveWindow.Close
End Sub