PDA

View Full Version : Solved: Set Focus



Levski
05-11-2005, 08:44 AM
Is there a VBA route to set focus to the active document so it assumes focus and appears at the front of the screen?

MOS MASTER
05-11-2005, 09:28 AM
Hi Lev, :D

Have a look at the Activate Method:
Application.Documents("Sales.doc").Activate
Application.ActiveDocument.ActiveWindow.Activate


Enjoy! :whistle:

Levski
05-11-2005, 09:55 AM
I tried activate previously but it produced eratic results. From memory, I think I may have inadvertantly placed this prior to setting visible to true and therefore it was ignored. I will run it for a bit and see what happens.

Thanks.

MOS MASTER
05-11-2005, 09:59 AM
Hi Lev, :D

You're welcome and if you have more issues with that just post the code that your using for comments!

Enjoy! :whistle:

Levski
05-11-2005, 11:53 AM
Thats all working out fine, can only imagine that the last time I tried Activate I placed to prior to making the application visible so the command failed.

Thanks :thumb

MOS MASTER
05-11-2005, 12:19 PM
Thats all working out fine, can only imagine that the last time I tried Activate I placed to prior to making the application visible so the command failed.

Thanks :thumb
Hi Lev, :D

Ah great it's working out for yah, you're welcome!

Yepz trying to activate something that is not visible is not really a good idea...:rofl:

Don't forget to mark your thread solved...

Till me meet again...:whistle: