We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Word to Email MSG file does not save any changes

Hi,

I am converting a Word document to mhtml stream and then saving as an MSG file so that the e-mail can be edited by the user before sending the e-mail on, however any changes made by the user to the e-mail are not sent on. The code I am using is:

//Open word document and convert to HTML Stream
MemoryStream mhtmlStream = new MemoryStream();
Aspose.Words.Document wordDocument = new Aspose.Words.Document(wordFilePath);

wordDocument.Save(mhtmlStream, SaveFormat.Mhtml);
mhtmlStream.Position = 0;

//Load the MHTML in MailMessage
MailMessage message = MailMessage.Load(mhtmlStream, MessageFormat.Mht);
message.Subject = subject;

MapiMessage mapiMsg = MapiMessage.FromMailMessage(message);

//Set the MapiMessageFlags as UNSENT
mapiMsg.SetMessageFlags(MapiMessageFlags.MSGFLAG_UNSENT);

//Save the MapiMessage to disk
mapiMsg.Save(@“C:\mail.msg”);

Thanks,

Richard.

Hi Richard,


Thank you for contacting Aspose support team.

I have tested your code without any change using Aspose.Email for .NET 4.2.0 and saved the output MSG file. This MSG file contains the word file contents as message body. This MSG file is opened in Outlook 2013 and body contents are edited and then Send button is pressed. It is observed that on the receiving end, modified body contents are received.

Could you please test the scenario with above mentioned latest release and let us know your feedback?
If it does not fulfill your requirement, please elaborate it more and provide some snapshots or other helping material which can be used to re-produce the scenario here and provide assistance as soon as possible.

Hi,

Thanks for checking that out, I will grab the latest version and try again.

Richard.

Hi Kashif,

This issue looks like it is to do with Office 2010. When I try this on 2007 it works as I would expect. In Office 2010 I have to save the e-mail message manually before I send it.

I decided to change the extension of the saved e-mail message to be .oft instead of .msg and it now works as I required.

Thanks for your help,

Richard.

Hi Richard,


Thank you for providing the feedback.

I was able to observe the issue while using Outlook 2010 at my end and have logged it as NETWORKNET-34394 in our bug tracking system for further investigation by the development team. We’ll update you here once there is some information available in this regard.

Hi Richard,


We have analyzed this issue at our end and came to conclusion that this can be achieved by clicking the Save button before sending the message. The issue is only reproducible with Outlook 2010 and is not an issue at our end as Outlook 2013 works fine.