This will close all Word documents.
You need On Error Resume Next to prevent errors if an instance of the Word application is not running.
Option Explicit Sub CloseWordDocuments() Dim objWord As Object Do On Error Resume Next Set objWord = GetObject(, "Word.Application") If Not objWord Is Nothing Then objWord.Quit Set objWord = Nothing End If Loop Until objWord Is Nothing End Sub
source share