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!

Return Focus to Modeless Userform (Word)

Status
Not open for further replies.

RP1America

Technical User
Aug 17, 2009
221
US
I have a Word document with a modeless userform that upon opening the file from, say my desktop, gives the userform and first text box focus. However, I also have this document saved in document storage application (Lotus Domino Document Manager). Upon opening the file through this, the document and userform show as before, however, this time the userform does not have focus (the document does).

Is there a code to give the userform focus? If so, where would such a code be placed, in the form's Initialize sub?

Thanks in advance!
 
Still need help with this if anyone has a suggestion.

Modeless form. Application (Word) has focus. How do I return focus to the userform without clicking on the userform?
 
Use the document's AutoOpen procedure.

Code:
Public Sub AutoOpen()
UserForm1.Show
UserForm1.TextBox1.SetFocus
End Sub
 
Thanks for the response mintjulep! However, this still has not corrected the issue.

Unfortunately, I think the document storage app that my company uses is causing the issue. So I'm looking for a workaround.

I really need a way to return focus to the userform after the document is already open. So for instance, if there was a button in the word application that a user clicked to return focus to the userform, what would be the code within that click event?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top