?
Solved

Folder Creator

Posted on 2003-10-24
2
Medium Priority
?
219 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
TwistD_PissR earned 120 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month13 days, 4 hours left to enroll

777 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