You can use the FindWindow function to get the window handle in the current active text application:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
The class name for MS Word is "OpusApp". If you have only one Word application open, the following returns to this window:
Public Function Test1()
Dim lhWnd As Long
lhWnd = FindWindow("OpusApp", vbNullString)
End Function
Note that if you have multiple active Word applications, you can add a title for the window title. For example, if you save it as "Stanigator.doc", the title will be considered "Stanigator - Microsoft Word". So:
Public Function Test2()
Dim lhWnd As Long
lhWnd = FindWindow(vbNullString, "Stanigator - Microsoft Word")
End Function
Another API that may come in handy is:
Private Declare Function GetActiveWindow Lib "user32" () As Long
Edit:
VSTO, , :
Connect Issue: VSTO API MS Word