Hi,
I have a problem opening a word document (embedded resource) from a memory stream. I always get the error message: Cannot access a closed stream. But I’m sure the stream isn’t closed. I’m using v. 2.1.12.0.
Heres a sample code:
Stream wordStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(typeof(Class1), "PressClippingTemplate.doc");
byte[] buffer = new byte[wordStream.Length];
MemoryStream memStream = new MemoryStream(buffer.Length);
wordStream.Read(buffer, 0, buffer.Length);
memStream.Write(buffer, 0, buffer.Length);
// wordStream.Close();
//memStream.Close();
Word.License license = new Word.License();
license.SetLicense(Assembly.GetExecutingAssembly().GetManifestResourceStream(typeof(Class1), "Aspose.Custom.lic"));
Word.Document document = null;
document = new Word.Document(memStream);
Any hints? It’s urgent because this is critical to my application…
Thanks in advance
Michael Mann