Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FileSystemObject error

Status
Not open for further replies.

rlamoreaux

Programmer
Aug 11, 2001
34
US
Have the following code. The problem I'm having is, If there is a file named myfile,yourfile,therefile.xyz in the inbox folder, the list of files generated by the ofilelist = ofolder.files command is
myfile
yourfile
therefile.xyx
There seems to be a problem when there is embedded commas????

Dim vFile, strRowSource, strPath
Dim oFileSys As New Scripting.FileSystemObject
Dim oFolder, oFileList As Object

''''''''''''''''''''''''''''''''''''''''
'Load and open inbox document container
''''''''''''''''''''''''''''''''''''''''
strPath = CurrentProject.path & "\"
Set oFolder = oFileSys.GetFolder(strPath & "inbox\")
Set oFileList = oFolder.Files

strRowSource = ""
For Each vFile In oFileList
strRowSource = strRowSource & vFile.Name & ";"
Next

Me.lbxFiles.SetFocus
Me.lbxFiles.RowSourceType = "Value List"
Me.lbxFiles.RowSource = strRowSource
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top