The MakeSureDirectoryPathExists API call is a favorite of mine. Credit to
Hack for first bringing it to my attention. I'd recommend it over the other API suggested because it doesn't require an hwnd.
It is worth pointing out that when you use it, your path must end with a "\". So here's a nice wrapper function for you:
Code:
Private Declare Function MakeSureDirectoryPathExists Lib "imagehlp.dll" (ByVal lpPath As String) As Long
Public Sub CreateFolder(ByVal pstrFolder As String)
If Right$(pstrFolder, 1) <> "\" Then pstrFolder = pstrFolder & "\"
MakeSureDirectoryPathExists pstrFolder
End Sub