I just don't understand why I cannot create directories on local windows PC, using MKDir for validation.. or var = dir(somepath,16)can anyone help?
I'm trying to export emails as eml files ( done!) but I wan't to export them in a folder scheme like they are entered into Notes Folders.
What is happening, on the first loop, if the directory doesn't exist, it's created, but on the second loop, the directory already exists and it all goes sideways..
Idea's anyone?
Sub makeTheDirectories (folderName As String, expdir As string)
'in this case example to work for you:
foldername = "issues\Notes\clients" ' or can be "Inbox" or "Issues\windows" (has to work in all three scenarios)
expdire = "C:\Users\%userProfile%\Documents\MailExport"
Dim tmp_array As Variant
Dim tmp_size As Integer
Dim count As Integer
Dim workdir As string
tmp_array = Split( folderName, "\")
tmp_size = UBound(tmp_array)
ChDir ( expdir )
count = 0
While (count <= tmp_size )
MkDir( tmp_array(count)) ' <<< Craps out here if the directory already exist.
workdir = workdir + tmp_array(count)
ChDir (workdir)
count = count + 1
Wend
End Sub