Streaming In Memory Word Document using OpenXML SDK w/ASP.NET results in “corrupt” document
问题 I am unable to stream a word document that I create on the fly down to the browser. I am constantly getting a message from Microsoft Word that the document is corrupt. When I run the code via a Console Application and take ASP.NET out of the picture, the document is generated correctly with no problems. I believe everything centers around writing the file down. Here is my code: using (MemoryStream mem = new MemoryStream()) { // Create Document using (WordprocessingDocument wordDocument =