Advertisement

10.05.2008 at 02:52PM PDT, ID: 23789081 | Points: 250
[x]
Attachment Details

Make a folder in MyDocumernts

Asked by isnoend2001 in Visual Basic Programming

How can i check if a folder exists in mydocuments and if not it is created. This created an error:
Private Sub Command4_Click()
Dim BidFileDir As String
BidFileDir = Environ("UserProfile") & "\MyDocuments\BidFileBackups"
CheckDirectory BidFileDir

End Sub




'if directory doesn't exist it's created
Public Function CheckDirectory(ByVal sDirectoryPath As String, Optional ByVal bCreateIfNotFound As Boolean = True) As Boolean
   If LenB(Trim$(sDirectoryPath)) > 0 Then
     CheckDirectory = (LenB(Trim$(Dir$(sDirectoryPath, vbDirectory))) > 0)
     If (Not CheckDirectory) And bCreateIfNotFound Then
          MkDir sDirectoryPath
     End If

  End If

End Function
Don't want to use fsoStart Free Trial
 
Keywords: Make a folder in MyDocumernts
 
Loading Advertisement...
 
[+][-]10.05.2008 at 03:21PM PDT, ID: 22646259

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.05.2008 at 03:22PM PDT, ID: 22646265

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.05.2008 at 03:33PM PDT, ID: 22646303

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.05.2008 at 04:30PM PDT, ID: 22646459

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.05.2008 at 04:46PM PDT, ID: 22646511

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628