I have a byte stream that actually (if correctly) forms a valid Word file, I need to convert this stream to a Word file without writing it to disk, I take the original stream from the SQL Server database table:
ID Name FileData ---------------------------------------- 1 Word1 292jf2jf2ofm29fj29fj29fj29f2jf29efj29fj2f9 (actual file data)
the FileData field contains data.
Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application(); Microsoft.Office.Interop.Word.Document doc = new Microsoft.Office.Interop.Word.Document(); doc = word.Documents.Open(@"C:\SampleText.doc"); doc.Activate();
The above code opens and fills the Word file from the file system, I do not want this, I want to define a new Microsoft.Office.Interop.Word.Document , but I want to manually fill in its contents from the byte stream.
After getting the Word document in memory, I want to parse the keywords.
Any ideas?
Kenan deen
source share