Unfortunately, the only option is to create a temporary file. Office does not support opening documents from any sort of memory stream or byte array. If you don't know how to programmatically query a database column and create a temporary file, please post a new question.
How to I open a word document stored in a database using .Net
-
31-05-2022 - |
Question
I have several MS Word documents stored as BLOBs in a SQL Server database.
I need to be able to:
- Open the document
- Set a few DOCVARIABLEs
- Print the document
I am very familiar with Word automation but I don't know how to open a document from the database. I am also open to solutions other than automation if they will accomplish the result.
I would very much like to avoid using a temporary file.
History:
I am rebuilding a legacy system written within Access 2003. The legacy system uses a control called UnboundObjectFrame to which the value is assigned. The frame then exposes appropriate automation objects. I can't find any equivalent control in .Net.
Jacob
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow