Dear ASPOSE team,
I am facing an issue with the html convertion.I am storing the document in Database and email it to the user as per request.The issue here is that some document is throwing error adn the email is not gone out (Document Attached).The code I am using is
Public Shared Function OutputDocDocument(ByVal docContent() As Byte, ByVal folderPath As String) As String
Dim license As Aspose.Words.License
license = New Aspose.Words.License
license.SetLicense(folderPath & "\Aspose.Total.lic")
Dim docDocument As Document
Dim strFn As String = Convert.ToString(DateTime.Now.ToFileTime())
Dim bytDoc() As Byte = docContent
Dim strPathFile As String = folderPath & "\WordDocs\" & strFn
Dim memFile As MemoryStream = New MemoryStream
memFile.Write(bytDoc, 0, bytDoc.Length)
docDocument = New Document(memFile)
docDocument.SaveOptions.HtmlExportHeadersFooters = False
docDocument.Save(strPathFile & ".htm", SaveFormat.Html)
Dim stmReader As StreamReader = File.OpenText(strPathFile & ".htm")
Dim strHTMLText As String = stmReader.ReadToEnd
OutputDocDocument = strHTMLText
stmReader.Close()
memFile.Flush()
memFile.Close()
DeleteFile(strPathFile & ".htm")
DeleteAllFiles(folderPath & "\WordDocs\", "*.png")
memFile = Nothing
docDocument = Nothing
stmReader = Nothing
license = Nothing
End Function
The code fails when it reaches docDocument.Save(strPathFile & “.htm”, SaveFormat.Html).
Could you please check it and get back to me ASAP