P
PeterM
I have some VBA code in a form that scans the users hard drive to get
directory information and loads it into a listbox. It works great except for
directories with special characters in the name such as lastname, firstname.
The comma is being interpreted as a separator in the code below
ChDrive (myDrive)
Chdir (myPath)
ctr = 0
myName = Dir("*.*", vbDirectory)
Do While myName <> ""
If myName <> "." And myName <> ".." Then
If (GetAttr(myPath & "\" & myName) And vbDirectory) =
vbDirectory Then
Me.filename_entries.AddItem myName, ctr
ctr = ctr + 1
End If
End If
myName = Dir
Loop
for the directory lastname, firstname I'm getting two entries; lastname and
firstname...any idea why?
Thanks in advance for your help!
directory information and loads it into a listbox. It works great except for
directories with special characters in the name such as lastname, firstname.
The comma is being interpreted as a separator in the code below
ChDrive (myDrive)
Chdir (myPath)
ctr = 0
myName = Dir("*.*", vbDirectory)
Do While myName <> ""
If myName <> "." And myName <> ".." Then
If (GetAttr(myPath & "\" & myName) And vbDirectory) =
vbDirectory Then
Me.filename_entries.AddItem myName, ctr
ctr = ctr + 1
End If
End If
myName = Dir
Loop
for the directory lastname, firstname I'm getting two entries; lastname and
firstname...any idea why?
Thanks in advance for your help!