Hi Rick --
Hi Karl, what are you doing over here... slumming? <g
I actually lurk a lot, but don't have much reason to chime in because most of the
questions are about the object model(s). And, more importantly, VBA is the only
Road Forward for ClassicVB at this point. Gotta keep the brand alive!
I only do Excel (now), so I can't speak for the other Office products, but
you can find an Excel UserForm's hWnd using the FindWindow API. Here is a
working line from the UserForm's Initialize event from one of my previous
postings ...
hWnd = FindWindow("ThunderDFrame", Me.Caption)
I have no idea whether ThunderDFrame is usable elsewhere.
That seems to be a pretty common classname. I see it throughout Office 2003, but
was afraid it might change from version to version. (Anyone know how universal it
is?)
Your method has the advantage of being callable on demand, while the method I
suggested is only good when the form first fires up. So I would think FindWindow
might indeed be a better way to go, *if* the classname is stable.
Thanks... Karl
--
..NET: It's About Trust!
http://vfred.mvps.org