UserForm Question

O

Owen

I am using a template document to automatically start a user form in Word 2003.

The user form contains command buttons, each command button opens a specific
template document.

Once the command button is clicked, the required document opens, however the
user form needs to be closed before the document can become active.

Is there a code that can be placed within my original template document
which automatically deactivates the user form and allows the selcted document
to become active?

I do not necessarily want to close the user form, just deactivate it so i
can use the opened document.

Regards
 
D

Doug Robbins - Word MVP

Use the .Hide command on the userform or change the mode in which the
userform is opened by adding vbModeless after the Show command

Show vbModeless

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
O

Owen

Thanks Doug

The UserForm.Hide worked.

Another question, when my UserFrom initially displays on screen, the window
is not active by default (ie the top caption bar is grey). Is there a command
to automatically make the UserForm window active (top caption bar is blue)?

Thanks again for your help.
 
D

Doug Robbins - Word MVP

How are you getting the userform to show?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
O

Owen

I have my document template linked to ashortcut on the desktop. When i
activate the template, the following code is used:

Sub autonew()
Application.WindowState = wdWindowStateMinimize
Selection.Document.Close
UserForm2.Show
End Sub

It minimses Word and closes the document which is opened from the template.
I did this because i only wanted the User Form to show on the screen and not
Word.

Thanks
 
D

Doug Robbins - Word MVP

Doing a bit of experimenting, I find that if in the Initialize event of the
form, I use the SetFocus command to set the focus to one of the controls on
the form, I then do not need to click twice on the form to activate any
other control.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
O

Owen

Thanks for your help on this one.

Doug Robbins - Word MVP said:
Doing a bit of experimenting, I find that if in the Initialize event of the
form, I use the SetFocus command to set the focus to one of the controls on
the form, I then do not need to click twice on the form to activate any
other control.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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