![]() ' We call AccessibleObjectFromWindow, passing the constant OBJID_NATIVEOM (defined in winuser.h) ' Search the accessible child window (it has class name "_WwG")ĭim cb As New EnumChildCallback(AddressOf EnumChildProc) WdPcs = Process.GetProcessesByName("WinWord") 'Get all instances of Word Public Function getAllWordDocuments() As List(Of .Document)ĭim wdDocumentsList As New List(Of .Document) Public Function EnumChildProc(ByVal hwndChild As Integer, ByRef lParam As Integer) As Boolean Private Declare Auto Function EnumChildWindows Lib "user32" (ByVal hWndParent As Integer, ByVal lpEnumFunc As EnumChildCallback, ByRef lParam As Integer) As Boolean Private Shared Sub GetClassName(ByVal hWnd As System.IntPtr, _īyVal lpClassName As, ByVal nMaxCount As Integer) ![]() Public Delegate Function EnumChildCallback(ByVal hwnd As Integer, ByRef lParam As Integer) As Boolean For future reference, I attach the code: Private Declare Function AccessibleObjectFromWindow Lib "oleacc" (ByVal Hwnd As Int32, _ With Cindy's tip, I was able to solve the problem.
0 Comments
Leave a Reply. |