Hi, we convert msg file to pdf in Asp.Net, after convert date will same as msg file but only time to change to other time.
Actual Time is http://prntscr.com/ikqs4f
But After convert time is http://prntscr.com/ikqsf9
Below is our code
Dim wordLicense As Aspose.Words.License = New Aspose.Words.License()
wordLicense.SetLicense(ConfigurationManager.AppSettings(“AsposeLic”))
Dim emailLicense As Aspose.Email.License = New Aspose.Email.License()
emailLicense.SetLicense(ConfigurationManager.AppSettings("AsposeLic"))
Dim pdfLicense As Aspose.Pdf.License = New Aspose.Pdf.License()
pdfLicense.SetLicense(ConfigurationManager.AppSettings("AsposeLic"))
Dim attFileName As New List(Of String)()
'Convert MSG to MHTML
Dim mailMsg As Aspose.Email.MailMessage = Aspose.Email.MailMessage.Load(inputfile)
Dim ms As New MemoryStream()
'Save as MHTML
' mailMsg.Save(ms, MailMessageSaveType.MHtmlFromat)
mailMsg.Save(ms, Aspose.Email.SaveOptions.DefaultMhtml)
'Convert MHTML to PDF
'create an instance of LoadOptions and set the LoadFormat to Mhtml
Dim loadOptions = New Aspose.Words.LoadOptions()
loadOptions.LoadFormat = Aspose.Words.LoadFormat.Mhtml
'create an instance of Document and load the MTHML from MemoryStream
Dim document = New Aspose.Words.Document(ms, loadOptions)
'create an instance of HtmlSaveOptions and set the SaveFormat to Html
Dim saveOptions = New Aspose.Words.Saving.PdfSaveOptions()
'save the document to Html file
document.Save(outputfile, saveOptions)
Regards,
Aravind