You will probably find that Word displays a dialog box. Make it visible so you can see what dialogue is.
wordApp.DisplayAlerts := wdAlertsNone;
also helps suppress alert dialogs
doc.Saved = true;
stops it by prompting you to save the changes when you close the document.
Frank source share