views:

32

answers:

1

Hi there,

I can successfully create folder directories with commas included in the name using the FileSystemObject

The problem that I am having is if a comma is included in the directory name I cant then use 'CopyFile' with this path name. The sub routine I use is below

Sub CopyFiles(sDoc As String, dDoc As String)
Dim fso As New FileSystemObject
   fso.CopyFile sDoc, dDoc, False
Set fso = Nothing
End Sub

I cant really avoid the use of commas, how can i prevent this from being a problem?

Thanks in advance for any help.

Cheers

Noel

+1  A: 

How about quotes:

fso.CopyFile """" & sDoc & """", """" & dDoc & """", False
Remou
FWIW, I define a constant in all my apps storing the double quote so I don't have to confuse myself counting four quotes everytime I want to do this.
David-W-Fenton
Cheers Remou, thanks for the tip David
glinch