Microsoft KB Archive/146922

= WD97: Selecting Multiple Files Names Results in Run-time Error 5174 =

Article ID: 146922

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Word 97 Standard Edition

-



This article was previously published under Q146922



SYMPTOMS
When you select multiple file names from the Open dialog box and then click the Open button, the following error message appears:

Run-time error '5174'

This file could not be found.



CAUSE
The Open dialog box from which you selected the file names is being displayed by a macro using the wdDialogFileOpen built-in Word dialog box.

Dialogs(wdDialogFileOpen).Show

You can select a single file and open it, but selecting multiple files at one time causes the error message.



MORE INFORMATION
You cannot select multiple files form the built-in Open dialog box in Word when displayed programmatically. This lack of functionality is by design in the previous and present versions of Word.

When you record a macro in Microsoft Word of opening multiple files form the Open dialog box the result is a series of statments:

Documents.Open FileName:=

Documents.Open FileName:=

Documents.Open FileName:=

This is the functionality of the Word Visual Basic for Applications constant wdDialogFileOpen which is different from Microsoft Excel Open dialog box functionality.

Additional query words: runtime

Keywords: kbbug kbnofix KB146922

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.