Using Aspose.Words version 5.0.2.0 in .Net 2.0 an error occurs with the attacted wordml file using the following code
string WordML = "wordml from file";
using (MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(WordML)))
{
try
{
MemoryStream s = new MemoryStream();
Aspose.Words.Document doc;
doc = new Aspose.Words.Document(stream, null, Aspose.Words.LoadFormat.WordML, null);
doc.Save(s, Aspose.Words.SaveFormat.Doc);
}
catch (Exception ex)
{
throw ex;
}
}
The following error occurs
The document appears to be corrupted and cannot be loaded. —> System.ArgumentNullException: Value cannot be null.
Parameter name: String
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Int32.Parse(String s)
at ?.?.?(String ?)
at ?.?.?(? ?)
at ?.?.?(? ?)
at ?.?.?()
at Aspose.Words.Document.?(Stream ?, LoadFormat ?, String ?)
— End of inner exception stack trace —
at Aspose.Words.Document.?(Exception ?)
at Aspose.Words.Document.?(Stream ?, LoadFormat ?, String ?)
at Aspose.Words.Document…ctor(Stream stream, String baseUri, LoadFormat loadFormat, String password)
When I open the wordml in microsoft word it opens fine.
Thanks