Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
02-18-2012, 08:44 PM #1
- Join Date
- Jan 2010
- Thanked 0 Times in 0 Posts
VB6: Bring form to top and activate?
I'm self-taught in VB macros in Word and Excel, and I dabble a bit in VB6 (Classic, not NET). I'm not at all up on APIs, relying on slurping from the internet.
I have a one-form program that works fine. I use it at church to pull up songs. I can type in the name or the first line of a song, and it searches a folder and pulls up the song as Word doc. At that point, the form is resized to about height of a Title bar and about 2" wide.
After opening the Word doc, I can use Me.SetFocus and Me.Text1.SetFocus to bring the form back on top and deactivate the Word window. This does two things: it allows me to close the Word doc by simply typing a 0, and it keeps me from accidentally typing in the doc.
But if the mouse gets clicked and the Word doc gets the focus, I'm kinda dead! I can get the form window on top of the Word window, but I can't make the form or VB the active application. I've got a timer in the form that keeps checking to see if there's an active Word doc object (just in case the doc gets accidentally closed); if not, it restores the form to full size. I'm trying to get it so if there is a doc object, then ensure VB and the form are on top and active.
Any help with this?