Can't Open Selected Document Using FileFind Macro

Last reviewed: February 5, 1998
Article ID: Q135590
The information in this article applies to:
  • Microsoft Word for Windows 95, version 7.0

SYMPTOMS

The Open button does not open the selected file after you run a WordBasic macro using the FileFind command; instead; it closes the Find File dialog box.

Steps to Reproduce Problem

To demonstrate this behavior, run the following macro:

Sub MAIN
   Dim dlg As FileFind
   GetCurValues dlg
   dlg.SearchPath = "c:\my documents"
   dlg.Name = "*.doc"
   x = Dialog(dlg)
   FileFind dlg
End Sub

STATUS

Microsoft has confirmed this to be a problem in Word for Windows 95 version 7.0. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

WORKAROUND

Because the FileFind command does not allow you to open a document, create another macro that uses the ChDir and FileOpen commands to set a search path for specific document names/types. For example:

Sub MAIN
   ChDir "C:\My Documents"
   Dim dlg As FileOpen
   dlg.Name = "*.doc"
   x = Dialog(dlg)
   FileOpen dlg
End Sub

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" 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.


KBCategory: kbusage kbmacro buglist7.0
KBSubcategory:
Additional reference words: 7.0 word95 winword word7 wordbasic macro word
basic filefind find file open does not doesn't won't close
Version : 7.0
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 5, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.