UserForm activates the first document it was loaded from (275977)
The information in this article applies to:
- Microsoft Office Word 2003
- Microsoft Word 2002
This article was previously published under Q275977 SYMPTOMS
You create a Microsoft Word template that contains a UserForm. You then open two or more documents that use the same template. When you do this, you may unexpectedly switch to the wrong document when you show the UserForm.
CAUSE
This problem can occur if all the following conditions are true:
RESOLUTIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. To resolve this behavior, change the code on the command button click event to unload the UserForm instead of hide the UserForm, as in the following example:
Private Sub CommandButton1_Click()
Unload UserForm1
End Sub
| Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
|---|
| Keywords: | kbprb KB275977 |
|---|
|