Cannot Change Directories to a UNC Path

ID: Q109565


The information in this article applies to:
  • Microsoft Word for Windows, version 6.0
  • Microsoft Windows 3.1


SYMPTOMS

When you use the CHDIR command to a UNC-named path, Word for Windows will not change to that directory.


CAUSE

The CHDIR command does not recognize "\\<networkname>\<share>\<directory>" as a valid directory, even though Word for Windows does support UNC paths in the WINWORD6.INI and WIN.INI files.


RESOLUTION

Specify a drive letter in the macro. The macro below will list the first file in the WINWORD directory on drive F:


 Sub MAIN
 ChDir "f:\winword"
 FName$ = Files$("*.*")
 MsgBox fname$
 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.

Additional query words: 6.0 word6

Keywords :
Version : WINDOWS:3.1,6.0
Platform : WINDOWS
Issue type :


Last Reviewed: January 10, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.