
11-23-2013, 06:32 AM
|
Novice
|
|
Join Date: Apr 2009
Posts: 10
|
|
Can no longer read and save WORD documents as TXT files
Hello, after getting a new Windows7 work PC, i can no longer programatically read WORD documents from a C# program and SAVE those WORD documents as new TXT files, but on my previous Windows7 work PC, I was able to read WORD documents and SAVE those WORD documents as new TXT files programatically using C#.
Also, on my new work PC, i don't have ADMIN rights, but i didn't have ADMIN rights on my previous work PC and was able to generate new TXT files from WORD documents programatically.
So for now, i'm transferring my WORD documents to my personal Windows8 machine at home and generating the TXT files there and tranferring the TXT files back to my Windows7 work machine.
I also checked the WORD option settings on my work PC and didn't see anything in particular that seemed to be blocking the reading and saving of WORD documents to a TXT file format ie:
Code:
Microsoft.Office.Interop.Word.Application newApp = new Microsoft.Office.Interop.Word.Application();
object miss = System.Reflection.Missing.Value; object path = pathin; object readOnly = false;
Document doc = newApp.Documents.Open(destFile, ref miss, ref readOnly, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss);
object format = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatDocument;
object nFileName = pathin + "\\" + fileName + ".txt"; object FileFormat =
Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatText;
object oMissing = System.Reflection.Missing.Value;
doc.SaveAs(ref nFileName, ref FileFormat, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
doc.Close();
Might anyone know if there is a WORD option setting i need to turn on or turn off or a configuration i need to change that will enable the reading and saving of WORD documents to TXT files programatically?
Thanks very much for any ideas! BobK
|