Microsoft KB Archive/96566

{|
 * width="100%"|

Macro to Generate Report of Files Found with FindFile Command

 * }

Q96566

-

The information in this article applies to:


 * Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c
 * Microsoft Word for Windows, version 7.0

-

SUMMARY
The Microsoft Word for Windows macro included in this article generates a report of the file names found in the Find File dialog box. Use this macro to return a list of the file names that match your Find File search parameters.

MORE INFORMATION
The macro displays the standard Find File dialog box; however, after you choose the Close button to exit the File Find dialog box, the macro asks the following question:

"Shall I insert a list of files found in a new document?" If you choose the Yes button, the macro creates a new Word for Windows document and inserts the file names of all files found.

CREATING THE MACRO
Use the steps appropriate for your version of Word.

Word 2.x

 * 1) On the File menu, click Template.
 * 2) Under &quot;Store New Glossaries and Macros As,&quot; select the Global option button, then choose the OK button.

NOTE: This step causes the new FileFind command to be stored in Normal.dot. If you want the new command to be template based, select the With Document Template option button instead of Global.
 * 1) On the Tools menu, click Macro.
 * 2) Under Show, select the Commands button. In the Macro Name box, select FileFind, then choose the Edit button.
 * 3) Delete the text in the macro-editing window and type the following macro text:
 * 4) On the File menu, click Close. Choose the Yes button when prompted to save changes to the macro.
 * 5) On the File menu, click Save All, and when prompted, choose to save global glossary and command changes.

Word 6.x, 7.0, and 7.0a

 * 1) On the Tools menu, click Macro.
 * 2) In the Macro Name box, type a name like FileList, then choose the Edit button (Word 6.x) or the Create button (Word 7.x).
 * 3) Type the following macro text:
 * 4) On the File menu, click Close. Choose the Yes button when prompted to save changes to the macro.
 * 5) On the File menu, click Save All, and if prompted choose yes to save changes to the Normal template.

This macro causes the Print and Open buttons to become unavailable in the Find File dialog box.

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code &quot;as is&quot; without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.