How to access other windows.

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
'Finds a window with the name, returns the handle.

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long
'Sends a specified message to the window handle that you give it.

Private Declare Function FlashWindow Lib "user32" (ByVal hwnd As Long, ByVal bInvert As Long) As Long
'Flashes the window.  This is how you can tell if you got the right window handle.

Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
'Gets a controls window handle.  The form window handle must be specified to get a decent control.

Const WM_SETTEXT As Long = &HC
'Sets the text of this control.

Private Sub Form_Click()
Dim hwnd As Long
Dim chwnd As Long

hwnd = FindWindow("Notepad", vbNullString)
'Find Notepad.

FlashWindow hwnd, 1
'Flash it so that you can find it.

chwnd = FindWindowEx(hwnd, ByVal 0&, vbNullString, vbNullString)
'Find a control window handle... in Notepad, there's the main Textbox that you want.
'Debug.Print chwnd can be used to check the validity of your control window handle

SendMessage chwnd, WM_SETTEXT, ByVal 0&, "AbcdEfg"
'Put some text into notepad.

End Sub