If Dir$("c:\temp",16)="" Then Mkdir "c:\temp"
If there are subdirectories then you have to make check each level eg:
If Dir$("c:\temp",16)="" Then Mkdir "c:\temp"
If Dir$("c:\temp\sub",16)="" Then Mkdir "c:\temp\sub"
You cannot make all directories in one go.
Then you can detach the file eg:
Dim htmlrt As Variant
Set htmlrt = uidoc.document.GetFirstItem("Htmlfile")
If htmlrt.type=richtext Then
Forall o In htmlrt.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
If Dir$("c:\temp",16)="" Then Mkdir "c:\temp"
Call o.ExtractFile( "c:\tempHTML\" & o.Source )
'do stuff then delete file
kill "c:\tempHTML\" & o.Source
End If
End Forall
End If