Issue in converting between Aspose Words and Aspose Email

Hello,
This issue is sure exists for some time, from when I started testing Words, not confirmed, I don’t know the root of issue is from Words or Email, so posted here to first diagnose where’s the problem?

Using Aspose Words, when I save a document as Mhtml in a MemoryStream, and then try to load it back using Aspose Email from MemoryStream and save as email or message, the inner images/resources will be lost.

Try to use an Html file as SourceFile with this sample:

    Dim MyDocEmail As Words.Document = New Words.Document(SourceFile, LoadOptions)
    Using MyMemoryStream As New MemoryStream
     MyDocEmail.Save(MyMemoryStream, MhtmlSave...)
     MyMemoryStream.Position = 0
     Using MyMailMessage As Email.MailMessage = Email.MailMessage.Load(MyMemoryStream, MhtmlLoad...)
      MyMailMessage.Save(TargetFile, EmlxSave...)
     End Using
    End Using

@australian.dev.nerds,

Could you please provide the following resources to replicate/investigate the issue on our end:

  1. Source Word document
  2. Aspose.Words generated MHTML along with images
  3. Aspose.Email generated email or message file showing the undesired behavior

Please try using the latest versions of Aspose.Words and Aspose.Email APIs while generating the output files.

1 Like

A ready to run project attached, simply run to reproduce, just copy the latest dlls of Aspose.Email.dll and Aspose.Words.dll

WindowsApplication4.zip (222.6 KB)

Thanks :slight_smile:

@australian.dev.nerds,

The example provided doesn’t match the description of your original issue. You mentioned MHTML , but the example is provided for HTML.
Secondly, when I run your project, I get an exception, which you have already mentioned on the Aspose.Email forum, and a ticket has already been created for this yesterday.