Word becomes active window - Why?

S

Slow Flyer

I am writing in VBA using Word.

If I run UserForm1 with no code, UserForm1 becomes the
active window (as expected).

But if UserForm1 includes the suggested code for the use
of msoFileDialogOpen, UserForm1 is no longer the active
window once it is run and the open file selection made.
Instead Word becomes the active window. UserForm1 has to
be clicked to make it the active window again.

How can I make UserForm1 automatically the active window
again (instead of word) following use of
msoFileDialogOpen?
 
C

Cindy Meister -WordMVP-

Hi Slow,

Have you set the UserForm to "Modal"?

How about having your code select (set the focus in) a
control on the UserForm?

Which version of Word is this?
I am writing in VBA using Word.

If I run UserForm1 with no code, UserForm1 becomes the
active window (as expected).

But if UserForm1 includes the suggested code for the use
of msoFileDialogOpen, UserForm1 is no longer the active
window once it is run and the open file selection made.
Instead Word becomes the active window. UserForm1 has to
be clicked to make it the active window again.

How can I make UserForm1 automatically the active window
again (instead of word) following use of
msoFileDialogOpen?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan
24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top