Case sensitivity in Mac Word 2004 filenames

H

Howard Kaikow

In another newsgroup, somebody reported that filenames are case sensitive in
Word 2004.
What does the following do in Word 2004?

Option Explicit
Private intFile As Integer
Private Sub OpenCaseSensitinity()
Dim strFilePath As String
strFilePath = "d:/command.txt"
intFile = FreeFile
OpenIt strFilePath
OpenIt UCase$(strFilePath)
OpenIt LCase$(strFilePath)
OpenIt "d:/cOmmANd.tXt"
End Sub
Private Sub OpenIt(strTargetFile As String)
On Error Resume Next
Open strTargetFile For Input As #intFile
If Err.Number = 0 Then
Debug.Print "OK: " & strTargetFile
Close #intFile
Else
Debug.Print "Booboo: " & strTargetFile
End If
End Sub
 
J

JE McGimpsey

Howard Kaikow said:
In another newsgroup, somebody reported that filenames are case sensitive in
Word 2004.
What does the following do in Word 2004?

If you change it to a valid Macintosh file path, you'll see that you
*may* get errors when you attempt to open the files with the path
converted to all uppercase or all lowercase.

The filenames themselves aren't case sensitive. The problem lies in the
Volume (hard disk) name, which is.

So if your HD name is "Macintosh HD", and your filename is "Command.txt"
in the folder "Users:Howard:Desktop" the following will work:


"Macintosh HD:Users:Howard:Desktop:Command.txt"
"Macintosh HD:users:howard:desktop:command.txt"
"Macintosh HD:USERS:HOWARD:DESKTOP:COMMAND.TXT"
"Macintosh HD:users:HOWARD:Desktop:COMMAND.TXT"
"Macintosh HD:USERS:howard:DESKTOP:command.txt"
"Macintosh HD:UsErS:hOwArD:dEsKtOp:CoMmAnD.tXt"

but these won't:

"macintosh hd:Users:Howard:Desktop:Command.txt"
"MACINTOSH HD:Users:Howard:Desktop:Command.txt"
 
H

Howard Kaikow

Thanx.

So, the drive name is the culprit.

I guess that makes sense, since for cross-platform, the filenames need to
work the same on windoze and the mac, but the drive designation must be
changed for each platform. One can code around this by testing for the
platform and setting the drive accordingly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top