I have a Word document in memory (which I loaded from my database). I am calling DocX.ReplaceText() to replace stuff and then I call DocX.Save(Stream) and pass in a MemoryStream. After I do that I read the data out of the MemoryStream and do
stuff with it.
The problem is that DocX.Save(Stream) closes the Stream that I passed in. Should it be doing that? Anyone passing in a FileStream probably won't mind because they would've just closed it right after the call anyway, but in my case I'm passing
in a MemoryStream. My opinion is that if I pass in a Stream that I opened, then it should be my responsibility to close it when I'm ready to close it.
I modified the DocX code on my machine to not close the Stream and everything works for me now... just thought I'd throw in my $.02.
BTW, DocX is awesome. I spent a month writing this kind of thing once, so I know how much of a pain it is. I love not having to write all that anymore!