Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word Document / UserForms Focus

Status
Not open for further replies.

RIJ

Programmer
Jul 16, 2002
8
AU
This one has been to MS - but not much joy with a good good solution...

Using WinXP, W2K - when a User Form comes to the screen it does not come to focus without this (as per MS 2nd level support):

(Application.Windows.Count).WindowState = wdWindowStateMinimize
Application.Windows(Application.Windows.Count).WindowState = wdWindowStateMaximize
Application.ActivateApplication.Windows


Likewise at the end of the VBA to get the document presented on the screen - except the last line needs to be first!

The problem comes about when more that one word document was open, when there is only one, there is no problem.

MS have acknowledged this as a problem.

Now, my problem is that in Win2K, or with WordXP - the same solution does not actually work to well. I get different results - like the finished form takes 60 seconds to appear...if a user form is used and includes the above code, then in WinXP the finished form does not come to focus...and lots of different behavours!

My questions is: how do i reliably get a user form to focus, and (then) get the final document to focus?
The application calling the Word VBA is a VB6 app which has ad the call procedure checked by MS.


Thanks in advance...
RIJ
 
RIJ:

You may want to check thread702-242141 - the code in it was created with Access in mind, and is therefore VBA, but should still work for you ...

If it does, glad to help - if it doesn't, guess we'll look for another solution. :)

Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top