There is no direct way to do this, as far as I know. Interactive Word libraries cannot read from a stream of bytes. If you are not working with huge (or huge) files, I would recommend just using the tmp file:
Application app = new Application(); byte[] wordContent = GetBytesInSomeWay(); var tmpFile = Path.GetTempFileName(); var tmpFileStream = File.OpenWrite(tmpFile); tmpFileStream.Write(wordContent, 0, wordContent.Length); tmpFileStream.Close(); app.Documents.Open(tmpFile);
I know that this is not the answer you are looking for, but in that case (where it takes quite a lot of time and fijing to do what you really want to do), it might be worth considering that time outweighs the performance at runtime.
If you still want to learn how to solve this problem, as you intend to, I would recommend the answers in this thread.
Anders arpi
source share