I only wanted to comment on D.Bugger solution, which is great and works with no problems.
I wanted to add that if some child entities are file attachments, you need to use the following sintax:
Call childTo.createHeader( mimeHeader.HeaderName ).Setheadervalandparams( mimeHeader.Getheadervalandparams() )
Because "the params" in the "Content-Type" and "Content-Disposition" headers contain meaningful information, namely the file attachment filename.
Also you should add at least another header to the ones you get from the childs, which is "Content-Type".
Otherwise the file attachment child entities are copied, but they'll lack a file name and type and therefore will be useless.
The complete corrected Do loop is here:
Do Until childFrom Is Nothing
Set childTo= mimeTo.createChildEntity()
Set mimeHeader= childFrom.GetNthHeader("Content-Type")
If Not mimeHeader Is Nothing Then
Call childTo.createHeader( mimeHeader.HeaderName ).Setheadervalandparams( mimeHeader.Getheadervalandparams() )
End If
Set mimeHeader= childFrom.GetNthHeader("Content-Disposition")
If Not mimeHeader Is Nothing Then
Call childTo.createHeader( mimeHeader.HeaderName ).Setheadervalandparams( mimeHeader.Getheadervalandparams() )
End If
Set mimeHeader= childFrom.GetNthHeader("Content-ID")
If Not mimeHeader Is Nothing Then
Call childTo.createHeader( mimeHeader.HeaderName ).Setheaderval( mimeHeader.Getheaderval() )
End If
Call CopyMultipartMime(childFrom, childTo)
Set childFrom = childFrom.GetNextSibling
Loop
Apart from this, thanks for your answer and sorry if I posted an answer, but I cannot comment on yours, apparently.