"Microsoft Word Err=1078 - This file could not be found..."

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

SYMPTOMS

When you run a macro that includes the ChDir WordBasic command, you get the following error message

   Microsoft Word Err=1078
   This file could not be found <Filename>

where <Filename> represents the name of the document you are trying to open.

CAUSE

The following macro fails because the ChDir command does not recognize a universal naming convention (UNC) path.

Sub Main
Chdir "\\Servername\Shared" FileOpen "default.doc"
End Sub

STATUS

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

RESOLUTION

Use the following WordBasic macro to access the UNC path. You can then change to the folder and select your file. The macro uses the Windows API SetCurrentDirectoryA function to change the folder. Note: The SetCurrentDirectoryA function name is case sensitive.

Declare Sub ChDirUNC Lib "kernel32" Alias "SetCurrentDirectoryA"(Path$)
Sub MAIN
S = ChDirUNC("\\servername\shared") ChDir "\\servername\shared" FileOpen "default.doc"
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 kberrmsg kbmacro buglist7.0
KBSubcategory: kbmacroexample
Additional reference words: 7.0 word95 macro change directory chdir
word7 winword wordbasic word basic
Keywords : kbmacroexample
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.