by Allen Wyatt
(last updated February 21, 2008)
Every time you choose Word from the Start menu, a new instance of Word is opened on your system. It is possible to have five, six, or more instances of Word open, each editing away on their own files. You can do this because of both the way Word is written (as a program) and the features built into Windows. In some user environments, it may not be beneficial to have multiple instances of Word open at the same time. There is no simple way to prevent this, but you can create an AutoExec macro that will not allow multiple instances of Word 97 to be open. (You cannot do this in versions of Word previous to Word 97 because they do not allow inspection of the entire range of applications open on a system.) The following VBA macro will accomplish this very task.
Sub AutoExec() thisinstance = Application.Tasks.Application.Caption If thisinstance = "Microsoft Word" Then j = 0 For Each i In Tasks If InStr(1, i.Name, thisinstance) > 0 Then j = j + 1 Tasks(i).Activate End If Next i If j > 1 Then Application.Tasks.Application.Quit Else For Each i In Tasks If InStr(1, i.Name, "Microsoft Word") > 0 Then If i.Name <> thisinstance Then i.Activate Application.Tasks(thisinstance).Close End If End If Next i End If End Sub
You should note that since this is an AutoExec macro (it automatically runs whenever Word is first started), there are some ways around it. If the user changes the Word command line (the one that actually starts Word) to use the /m switch, or if the user holds down the Shift key while Word is starting, then the AutoExec macro will not execute.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (390) applies to Microsoft Word 97.
Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!
The status bar is used to display all sorts of information about the document on which you are working. Depending on your ...Discover More
Word employs what is called a context-sensitive help system. This means that the program tries to direct you to the portion ...Discover More
When you have multiple documents open at the same time, you need a way to control how those document windows appear on the ...Discover More
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.