I have an app that takes Msg files and prints the pages to PNG. I was never able to get this working directly in Aspose.Email, so have had to convert the E-Mail to word, and then use Aspose.Word to create the images. This works fine. Except, for some reason or other, in some mails it includes the attached pictures as part of the E-Mail body. If you check the E-Mail, the pictures are not embedded in the E-Mail, so there should be no reason for them to be included in the mail. Here is the code that I use to do the conversion:
Dim msg As Aspose.Email.MailMessage
Dim LoadOptions As New Aspose.Email.MsgLoadOptions()
msg = Aspose.Email.MailMessage.Load(“MSG.MSG”)
Dim msgStream As New System.IO.MemoryStream()
msg.Save(msgStream, Aspose.Email.SaveOptions.DefaultMhtml)
msgStream.Position = 0
Dim WordLoadOptions As New Aspose.Words.LoadOptions
WordLoadOptions.LoadFormat = Aspose.Words.LoadFormat.Mhtml
Dim msgDocument As Aspose.Words.Document
msgDocument = New Aspose.Words.Document(msgStream, WordLoadOptions)
Dim pngFilename As String
Dim Wordoptions As Aspose.Words.Saving.ImageSaveOptions = New Aspose.Words.Saving.ImageSaveOptions(Aspose.Words.SaveFormat.Png)
Wordoptions.ImageColorMode = Aspose.Words.Saving.ImageColorMode.None
Wordoptions.ColorMode = Aspose.Words.Saving.ColorMode.Normal
For a = 0 To msgDocument.PageCount - 1
If a < msgDocument.PageCount Then
Wordoptions.PageIndex = a
pngFilename = “C:\Temp” & a + 1 & “.png”
msgDocument.Save(pngFilename, Wordoptions)
End If
Next
Can you let me know what I can do to sort this out? If I can do this directly within Aspose.EMail, then fine. Else how do I tell Apose.EMail not to include the images when converting to MHTML?