'************************************** ' Name: Recursive Make Folder ' Description:This function is a recursi ' on code example of making a folder with ' no added global variables or trailing pa ' rameters, simply just the initial needed ' parameter of the path to the folder to c ' reate and it will make it and any other ' path it may need to make not existing do ' wn the depth of the directory structure. ' My own strict requirements before postin ' g, when I all of a sudden needed, this a ' bility was strictly that it be one funct ' ion only. The result return is the path ' created (or already existing), otherwise ' an error will be raised. ' By: Nicholas Forystek ' ' ' Inputs:None ' ' Returns:None ' 'Assumes:None ' 'Side Effects:None '************************************** Public Function MakeFolder(ByRef Path As String) On Error Resume Next If InStr(Path, "\") > 0 Then GetAttr Left(Path, InStrRev(Path, "\") - 1) If Err.Number = 76 Or Err.Number = 53 Then Err.Clear MakeFolder = Path Path = MakeFolder(Left(Path, InStrRev(Path, "\") - 1)) Else MakeFolder = Path End If End If If Err.Number = 0 Then GetAttr MakeFolder If Err.Number = 76 Or Err.Number = 53 Then Err.Clear On Error GoTo -1 MkDir MakeFolder End If End If End Function