CurrentProject.Path

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

Apparently, when you use CurrentProject.Path and the path has spaces or the file name too long it when you try to execute ftp in a shell and specify that deep path it won't run it. Is there a different version of CurrentProject.Path that will give the path in the Dos naming format or maybe another idea to work around this

Thanks
ari
 
Hi Ari,

One way (probably not the most elegant) is to use the FileSystemObject
object. I think something like this aircode will do the trick:

Dim fso As Scripting.FileSystemObject
Dim f As Scripting.File
Dim strPath As String

Set fso = New FileSystemObject
Set f = fso.GetFile CurrentProject.Path

strPath = f.ShortPath

Set f = Nothing
Set fso = Nothing
 
Back
Top