Looking for some help to figure out on how can I save the output of my C# program into the word file?
- class Test
- {
- static void Main(string[] args)
- {
- Application app = new word.Application();
- Document doc = app.Documents.Open(filePath);
- ////Lines of Code
- Console.WriteLine(); //Output
- //How to save the above Console.Writeline in the word file??
- Doc.close();
- App.Quit(); } }
Ram PrasadPosted Feb 12, 2020, 6:56 AM
PustingPosted Feb 10, 2020, 11:49 PM
Ram PrasadPosted Feb 10, 2020, 10:33 PM
PustingPosted Feb 5, 2020, 2:47 AM
So basically, this will redirect the Console.WriteLine to that StringWriter, but if you want to have the output text in both Console and in some String variable for you to use it, then you'll need to use Console.SetOut with something like this mirror writer:
Also, I'm using GemBox.Document to write into a DOCX file, for more info about that you can see:
Ram PrasadPosted Jan 30, 2020, 1:57 AM
Amit MohantyPosted Jan 23, 2020, 2:10 PM
Ashutosh GuptaPosted Jan 22, 2020, 11:28 AM
Sapna GirishPosted Jan 22, 2020, 7:03 AM