@australian.dev.nerds Unfortunately, I cannot reproduce the problem on my side. I have used the following code for testing:
Document doc = new Document(@"C:\Temp\in.mht");
// Save as DOCX
doc.Save(@"C:\Temp\out.docx");
// Save as RTF
RtfSaveOptions rtfOpt = new RtfSaveOptions();
rtfOpt.ExportCompactSize = true;
rtfOpt.ExportImagesForOldReaders= true;
rtfOpt.SaveImagesAsWmf = true;
rtfOpt.PrettyFormat= true; // Does not have effect for RTF.
doc.Save(@"C:\Temp\out.rtf", rtfOpt);
// Save as SVG
SvgSaveOptions svgOpt = new SvgSaveOptions();
svgOpt.ExportEmbeddedImages = true;
doc.Save(@"C:\temp\out.svg", svgOpt);
Here are output documents produced on my side: out.zip (10.6 KB)
You can load TXT document using code like this:
Document doc = new Document(@"C:\\Temp\\in.txt");
or by explicitly specifying load format:
Document doc = new Document(@"C:\\Temp\\in.txt", new LoadOptions() { LoadFormat = LoadFormat.Text });
Or by specifying additional TXT load options:
TxtLoadOptions opt = new TxtLoadOptions();
opt.TrailingSpacesOptions = TxtTrailingSpacesOptions.Trim;
Document doc = new Document(@"C:\\Temp\\in.txt", opt);
Your code throws an exception on this line when I run it on my side:
If MyMailMessage.IsEncrypted = True Then MyMailMessage = MyMailMessage.Decrypt()
If comment this line of code the output loos fine: Target.zip (110.4 KB)
Also, it is not quite clear what is the purpose of converting Mhtml to Mhtml using Aspose.Email before converting to using Aspose.Words. Why dont you simply convert the Mhtml directly using Aspose.Words as in my example?
@australian.dev.nerds Unfortunately, I cannot reproduce the problem you have described neither by direct document conversion using Aspose.Words nor using the code you have provided.