Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Modifying Behavior of the Open Dialog Box.

Modifying Behavior of the Open Dialog Box

Written by Allen Wyatt (last updated February 1, 2023)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


Bronwyn asked if there was a way to force the Open dialog box to stay visible so that multiple files could be opened consecutively. While multiple documents can be opened at the same time using the Open dialog box, this isn't what Bronwyn wanted to do.

One solution—that only tangentially involves Word—is to use the File Explorer (Windows 10) or Windows Explorer (earlier versions of Windows) to display the files in a folder. Open an Explorer window that shows all the document files. You can then double-click on files, or create a selection set of files and right-click on them and choose Open. The window is continually available, and you don't need to worry about repeatedly displaying the Open dialog box.

If you prefer a solution directly within Word, just remember that Word is very configurable, which means you can change just about every aspect of the program. This includes the behavior of the Open dialog box. All you need to do is create a replacement for the FileOpen command, as in the following:

Public Sub FileOpen()
    Dim err_handler
    On Error GoTo err_handler

    With Dialogs(wdDialogFileOpen)
        .Name = "*.*"
        Do While .Show <> 0
            .Name = "*.*"
        Loop
    End With
    Exit Sub

err_handler:
    If Err.Number = 5174 Then
        MsgBox "You can open only one file at a time.", vbCritical
        Resume Next
    Else
        MsgBox Err.Number & vbCrLf & Err.Description, vbExclamation
    End If
End Sub

With this macro in place, whenever Word displays the Open dialog box, it does so with All Files as the specified file type. You can then select a file, and the dialog box again opens to await your next selection. If you click Cancel on the dialog box, then the command ends and you can begin your other tasks in Word.

There is a difference between this implementation of the Open dialog box and the one that is presented normally by Word. In Word, you can create a "selection set" within the Open dialog box so that you can open multiple files at the same time. When you use the wdDialogFileOpen dialog box (as is done when you create your own replacement for the Open command), you can only select a single file at a time. This didn't seem to be a big problem for Bronwyn, but could be a problem for other users.

If you must retain the ability to open multiple files at once, then you can execute a commandbarcontrol. However, in executing the commandbarcontrol, you cannot test if someone clicks Cancel. Therefore, you need another way to get out of the loop. In the following routine, you can select/open multiple files, but you must also respond to a dialog box to exit the loop that shows the dialog box.

Sub GetNewFiles()
    Dim Response
    Do While Response <> vbNo
        CommandBars("Standard").Controls("&Open...").Execute
        Response = MsgBox(Prompt:="Open another file?", Buttons:=vbYesNo)
    Loop
End Sub

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (12357) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. You can find a version of this tip for the older menu interface of Word here: Modifying Behavior of the Open Dialog Box.

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

Entering or Importing Times without Colons

Enter a time into a cell and you normally include a colon between the hours and minutes. If you want to skip that pesky ...

Discover More

Embedded MP4 Files in a PDF Document

There are several ways you can create PDFs from your Word documents. When doing so, not everything in the Word document ...

Discover More

Monday's Date on Friday's Report

Automatically putting today's date at the top of a report is easy. Putting a different date, automatically, can be more ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More WordTips (ribbon)

Reversing All the Paragraphs in a Document

Documents consist of a series of paragraphs, arranged in the order in which you need them. What if you need to reverse ...

Discover More

Determining the Hour of the Day

Need to figure out the hour represented by a particular time value? It's easy to do in a macro; just use the Hour ...

Discover More

Attaching Macros to Documents

When you distribute documents to other people, you may want those documents to have associated macros that the reader can ...

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}] (all 7 characters, in the sequence shown) 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 2 + 2?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
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.