Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_CLOSE = &H10
sub killWord()
dim h,h1 as long
Do
h = FindWindow("OpusApp", vbNullString)
If h = 0 Then Exit Do
h1 = SendMessage(h, WM_CLOSE, 0, 0)
Loop
end sub
可以根据实际情况修改