Solved

Folder Creator

Posted on 2003-10-24
2
211 Views
Last Modified: 2013-12-03
I need to code to check if a folder exists and if the folder doesnt create it!!! thanx in advance

Text1.Text = the path
0
Comment
Question by:burnttime
2 Comments
 
LVL 1

Accepted Solution

by:
TwistD_PissR earned 30 total points
ID: 9616059
Dim FSO As Object
Dim sNewFolder As String
   
  sNewFolder = Text1.Text
  Set FSO = CreateObject("Scripting.FileSystemObject")
  If Not FSO.FolderExists(sNewFolder) Then
    FSO.CreateFolder sNewFolder
  End If
  Set FSO = Nothing



TwistD
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 9617295
Why not just use:

If Dir(Text1.Text, vbDirectory) = "" Then MkDir Text1.Text



0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now