Single Instance of Word

by Allen Wyatt
(last updated February 21, 2008)

1

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.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Workbook not Saving

Having trouble saving a workbook? It could have to do with the age, size, and complexity of that workbook. This tip offers ...

Discover More

Controlling How Word Sorts Text

Word has an orderly way in which it sorts information, but that orderly method may not meet what you need to have done. Here ...

Discover More

Rounding To the Nearest Even Integer

Do you need your numbers to be rounded to an even integer value? How you accomplish the task depends on the nature of the ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (menu)

Understanding the At and Ln Indicators

Part of the helpful information that Word provides on the status bar is designated by the labels "At" and "Ln." Here's what ...

Discover More

Viewing Your Document Full-Screen

Want to see the absolute most of your document that you can? Then you need to become familiar with the full-screen display ...

Discover More

Discovering Where Word Stores Settings

How to find your setting information in Word.

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is four less than 9?

2013-02-12 04:08:36

sadhu

I pointed the Word startup shortcut at a simple autohotkey macro:

if WinExist("Microsoft Word") {
WinActivate
} else {
run, C:Program` Filesoffice97OfficeWINWORD.EXE
}

Now I never get multiple instances of Word, regardless of /m, macro protection, etc. (I am running WinXP Pro SP3 -- downgraded from Win7 Ultimate which was driving me crazy)


sadhu!


This Site

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.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.