Jay, thank you. The other APIs below are ones I had just copy/pasted from the web, but I haven't used windows API enough to know what they mean.
Based on searching the web to learn more about SetWindowPos, I got the following code working. The only thing I wish I could change is to leave the original height by default rather than having to set it, but I'm not sure how to do that :)
Since I do have the narrower width, I'm going to mark this question as answered. Thanks again!
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 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.
Option Base 1
'----------------------------------------------------------------------------------
'--- added for the code to narrow the notepad window size when reviewing bookmark names --------
'----------------------------------------------------------------------------------
'Private Declare Function FindWindow Lib "user32.dll" Alias _
'"FindWindowA" (ByVal lpClassName As String, _
'ByVal lpWindowName As String) As Long
Private Declare Function SetParent Lib "user32.dll" _
(ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function SetWindowPos Lib "user32.dll" _
(ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
ByVal x As Long, ByVal y As Long, ByVal cx As Long, _
ByVal cy As Long, ByVal wFlags As Long) As Long
'Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Const SWP_NOZORDER As Long = &H4
Private Const SWP_SHOWWINDOW As Long = &H40
Const HWND_TOP = 0&
Const SWP_NOMOVE = &H2
Private Sub textsdfs()
Write2Notepad ("A47J12")
End Sub
Sub Write2Notepad(MyStr As String)
Dim hwnd As Long
Dim chWnd As Long
Dim s As String
'start Notepad
Call Shell("NOTEPAD.EXE", vbNormalFocus)
hwnd = FindWindow("Notepad", vbNullString)
'Find a control window handle... in Notepad, there's the main Textbox that you want.
chWnd = FindWindowEx(hwnd, ByVal 0&, vbNullString, vbNullString)
SendMessage chWnd, WM_SETTEXT, ByVal 0&, MyStr
'hWnd.Width = 100
'SetWindowPos hwnd ', 0&, 0&, 0&, 100&, 600
'Resize the Window
SetWindowPos hwnd, 0, 0&, 0&, 400&, _
900&, SWP_NOZORDER Or SWP_SHOWWINDOW
End Sub