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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating a file folder

Status
Not open for further replies.

cmz21

Programmer
May 5, 2005
110
US
Hello,
I have found that I can create a directory using the code:

MkDir "C:\My Documents"


I was wondering if there is a simple way to check if this directory already exists before it is created.

Thanks
cmz
 
Search for help on MkDir

Since you're using the MkDir....

strPath = Dir("C:\My Documents", vbDirectory)
If strPath <> "" then
' It Exists
End if


"Hmmm, it worked when I tested it....
 
thank you.....
I was missing the vbDirectory part. Working perfectly now.

cmz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top