CurrentProject.Path

A

ari

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
 
J

John Nurick

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
 

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