There is no supported way to do this right now using Interop.Word , as there are no methods for supporting byte arrays.
As a viable workaround, you can use a temporary file as follows:
// byte[] fileBytes = getFileBytesFromDB(); var tmpFile = Path.GetTempFileName(); File.WriteAllBytes(tmpFile, fileBytes); Application app = new word.Application(); Document doc = app.Documents.Open(filePath); // .. do your stuff here ... doc.Close(); app.Quit(); byte[] newFileBytes = File.ReadAllBytes(tmpFile); File.Delete(tmpFile);
For more information, read this post .
source share