如果知道Word.Exe的窗口标题,可以用FindWindow来得到它的窗口句柄:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
用API GetMenue函数:
Private Declare Function GetMenu Lib "user32" Alias "GetMenu" (ByVal hwnd As Long) As Long
Private Sub Command1_Click()
Dim mHwnd As Long
mHwnd=GetMenu(Word.exe的窗口句柄)
End Sub