I need to analyze a long list of items in a table within a MS Word doc. Naturally, I thought writing a simple C# program to process all this would be useful.
I noticed that when I use the Interop, it also creates a backup while it’s open. That’s a waste because I only want to read it.
wordApp = new Microsoft.Office.Interop.Word.Application();
wordApp.Documents.Open("yada.docx");
Well, I looked on the MS website, lo and behold, there is a read only flag.
Naturally, I put it to use…
wordApp = new Microsoft.Office.Interop.Word.Application();
wordApp.Documents.Open("yada.docx",false, true,false);
Opps. MS, as typical, shot me in the foot. Although I did not alter or save the document after scanning the table inside it, suddenly now when I open it with MS Word, opens as ‘Read Only’
And NOT as a file system properties. It’s something INSIDE the doc file. And now I can’t figure out how to get rid of that setting!
See the images below. Any help is appreciated!