WordBasic Returns MS-DOS Path with Wrong Capitalization (138274)



The information in this article applies to:

  • Microsoft Word for Windows 95

This article was previously published under Q138274

SYMPTOMS

When you use any of the following WordBasic commands, the information may be returned in either all uppercase letters or mixed uppercase and lowercase letters.

FileName$()
Files$()
GetAddinName$()
SelectionFileName$()
FileNameInfo$()

CAUSE

Any file or folder (directory) originally created under MS-DOS will be returned in all uppercase letters.

Files and folders created under Windows 95 are returned with the same capitalization as they were created.

For example, if you create a file in MS-DOS named OLDDOS.TXT and run the following macro on it:
     Sub MAIN
     MsgBox FileName$()
     End Sub
				
Word will show its name as
     C:\My documents\DOSDIR\OLDDOS.TXT
				

WORKAROUND

Give the file or folder a new name in Windows 95:
  1. Using Windows Explorer, click the file or folder.
  2. Press F2 and type a different temporary name.
  3. Press ENTER.
  4. Press F2 and retype the original name with the desired capitalization.
  5. Press ENTER.
The WordBasic commands will now return the expected results.

Renaming the file or folder with the same name isn't sufficient; you must give the file a new name first and then give it the original name.

Modification Type:MinorLast Reviewed:8/17/2005
Keywords:kbmacro KB138274