楼主看看找的是不是这个
Declare Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function FindWindowExA Lib "user32" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, _
ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long
Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Declare Function GetWindowTextA Lib "user32" (ByVal hwnd As Long, ByVal lpString As String, _
ByVal cch As Long) As Long
Function GetTheHwnd() As Long
Dim XlHwnd As Long
Dim WbHwnd As Long
Dim GText As String
Dim GTextL As Long
XlHwnd = FindWindowA("XLMAIN", vbNullString) '主體窗口句柄
WbHwnd = FindWindowExA(XlHwnd, 0&, "EXCELC", vbNullString) '預覽窗口句柄
GetTheHwnd = FindWindowExA(WbHwnd, ByVal 0&, "Button", vbNullString) '文件窗口句柄
'GetTheHwnd = FindWindowExA(WbHwnd, ByVal 0&, "Button", "縮放(&Z)") '文件窗口句柄
'EnableWindow GetTheHwnd, False
Do While GetTheHwnd > 0
GText = Space(256)
GTextL = GetWindowTextA(GetTheHwnd, GText, 256)
EnableWindow GetTheHwnd, False
If GTextL <> 0 Then Debug.Print GetTheHwnd, Left$(GText, GTextL)
GetTheHwnd = GetWindow(GetTheHwnd, 2) '同級下一個窗口
Loop
End Function