I am trying to open a word document that was created with an Older version of Aspose.Word. When I call the Open() with a file path. An exception is raised. It is Stylesheet is missing. Any help would be verrrry appreciated Here is the method:
Try
Dim strFiles() As String = System.IO.Directory.GetFiles(Global.g_TempDirectory, "*.doc")
If IsNothing(strFiles) = False AndAlso strFiles.Length > 0 Then
Dim iPos As Int32 = 0
Dim inStreams(strFiles.Length - 1) As System.IO.Stream
Dim pdfEditor As PdfFileEditor = New PdfFileEditor
Dim strFileName As String = String.Empty
For Each strfile As String In strFiles
'Save the document in Aspose.Pdf.Xml format into a memory stream.
'Dim stream As MemoryStream = New MemoryStream
'doc.Save(stream, SaveFormat.FormatAsposePdf)
'Seek to the beginning so it can be read by XmlDocument.
'stream.Seek(0, SeekOrigin.Begin)
Dim doc As New Document
Dim docMS As New MemoryStream
Dim wrd As New Word
'doc = New Document(strfile)
'doc.Save(docMS, SaveFormat.FormatAsposePdf)
wrd.Open(strfile).Save(strfile.Replace(".doc", ".xml"), SaveFormat.FormatAsposePdf)
'Load the document into an XmlDocument
Dim xmlDoc As XmlDocument = New XmlDocument
docMS.Seek(0, SeekOrigin.Begin)
'Load the file
xmlDoc.Load(docMS)
'Load the XML document into Aspose.Pdf
Dim pdf As Aspose.Pdf.Pdf = New Aspose.Pdf.Pdf
'Make sure the images that were saved by Aspose.Word into Windows temporary
'folder are automatically deleted by Aspose.Pdf when they are no longer needed.
pdf.IsImagesInXmlDeleteNeeded = True
pdf.BindXML(xmlDoc, Nothing)
strFileName = strfile.Replace("doc", "pdf")
'Now produce the PDF file.
'pdf.Save("Aspose.Word.Demos.pdf", Aspose.Pdf.SaveType.OpenInBrowser, Me.Response)
pdf.Save(strFileName)
Next
End If
Catch ex As Exception
txtError.Text = ex.Message
End Try