WordBasic Returns MS-DOS Path with Wrong Capitalization

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

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.


KBCategory: kbusage
KBSubcategory: kbmacro
Additional reference words: 7.0 word95 word7 file macro capital winword
upper case lower case
Keywords : kbmacro
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.