This article was previously published under Q285885
This article has been archived. It is offered "as is" and will no longer be updated.
When you automate multiple instances of Microsoft Word simultaneously, the user may receive one or more of the following warnings:
"Normal.dot was being edited by another Word session. If you save this document with the original name, you will overwrite any changes made in the other session.Do you want to save the document using the original name anyway?"
This file is in use by another application or user. (C:\Documents and Settings\...\Normal.dot)
These warnings may occur if changes are made to the Normal.dot template.
To resolve this problem, do one of the following:
Before you quit Word or transfer control to the user, set the Saved property of the Normal.dot template to True as follows:
Application.NormalTemplate.Saved = True
Set the SaveChanges argument for the Quit method as follows:
Steps to Reproduce Behavior
In Visual Basic, create a new Standard EXE project. Form1 is created by default.
On the Project menu, click References, and then add a reference to your version of the Microsoft Word Object Library.
Add a CommandButton control to Form1.
Add the following code to the form:
Private Sub Command1_Click() Dim wdApp1 As Word.Application Dim wdApp2 As Word.Application Set wdApp1 = CreateObject("Word.Application") wdApp1.Visible = True wdApp1.Documents.Add Set wdApp2 = CreateObject("Word.Application") wdApp2.Visible = True wdApp2.Documents.Add MsgBox "Change the default font of document 2." wdApp2.ActiveDocument.Close False wdApp2.Quit Set wdApp2 = Nothing wdApp1.Quit Set wdApp1 = NothingEnd Sub
Run the Visual Basic project and click the command button.
A message box directs you to change the default font for the second document. On the Format menu, click Font, and then click Default. When you are prompted to change the default font, click Yes, and then click OK to dismiss the message box.
When the second Word instance is closed, one of the warnings shown in the "Summary" section appears.
To resolve this issue in the code above, do one of the following:
Add the following line before the call to the wdApp2.Quit method:
wdApp2.NormalTemplate.Saved = True
Use the SaveChanges argument of the Quit method as follows: