excel - VBA enumerate through using enumchildwindows -
i'm trying create excel document communications 1 of our external apps.
i have sendmessage working in order wm_gettext specific window, can't next childwindow class names same:
my first code grabs text first class under parentwindow named "windowsforms10.edit.app.0.2004eee"
grange = findwindow(vbnullstring, "general account enquiry") account_number = findwindowex(grange, 0&, "windowsforms10.edit.app.0.2004eee", vbnullstring) the_count = sendmessage(account_number, wm_gettextlength, 0&, 0&) buffer$ = space$(the_count) call sendmessagebystring(account_number, wm_gettext, the_count + 1, buffer$)
but need grab text circled red box, has same class name. have experience api calls class names unique.
i've been told helpful stackoverflow contributor use enumchildwindows cycle through 5 other child windows of same name, after few days searching havn't been able find right code this.
is able or provide example code can work with?
thank much
looks managed figure out 5 minutes after posting this,
grange = findwindow(vbnullstring, "general account enquiry")
account_number = findwindowex(grange, 0&, "windowsforms10.edit.app.0.2004eee", vbnullstring) account_number2 = findwindowex(grange, account_number, "windowsforms10.edit.app.0.2004eee", vbnullstring) account_number3 = findwindowex(grange, account_number2, "windowsforms10.edit.app.0.2004eee", vbnullstring) account_number4 = findwindowex(grange, account_number3, "windowsforms10.edit.app.0.2004eee", vbnullstring) account_number5 = findwindowex(grange, account_number4, "windowsforms10.edit.app.0.2004eee", vbnullstring) account_number6 = findwindowex(grange, account_number5, "windowsforms10.edit.app.0.2004eee", vbnullstring) account_number7 = findwindowex(grange, account_number6, "windowsforms10.edit.app.0.2004eee", vbnullstring) the_count = sendmessage(account_number6, wm_gettextlength, 0&, 0&) buffer$ = space$(the_count) call sendmessagebystring(account_number6, wm_gettext, the_count + 1, buffer$) thisworkbook.sheets("sheet1").range("a2") = buffer$
Comments
Post a Comment