Cannot Change Directories to a UNC Path

ID: Q109565

The information in this article applies to:

SYMPTOM

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.

Kbcategory: kbusage kbmacro KBSubcategory: Additional query words: 6.0 word6

Version           : 6.0
Platform          : WINDOWS

Last Reviewed: July 30, 1997