Public function CloseAll_WinWord_Files() Dim strComputer Dim objWMIService Dim colProcessList Dim objProcess strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colProcessList = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = 'WINWORD.EXE'") For Each objProcess in colProcessList objProcess.Terminate() Next End Function
No comments:
Post a Comment