Reputation: 2297
I am working on project which needs to read .doc file given by client. It needs to replace some text in that and save again, so user can have that file with their own data.
i.e. we normally do parameters read while sending mail to client. (just an example)
I have read some post about it and it needs MS word to be install on server. Is there a way to do my requirements without MS word dll
I tried to convert that file in .htm and read the text and replace it however the final thing i need to convert that .htm file back to .doc file. when i do that manually all the watermark text and logos etc are not in the new .doc file. So that is useless for me.
Can anyone please suggest me the way I can try and go ahead.
Thanks in advance
Upvotes: 2
Views: 3240
Reputation: 2297
After spending some hours on R&D, at last I got, I like to post this as answer,so everyone can use.
The exactly suitable answer for my question i found :)
Just download the application and take your suitable function. In my case....
Console.WriteLine("\tReplaceTextParallel()\n");
DocX document = DocX.Load("D:\\mytest.docx");
document.ReplaceText("{@adress12345}", "This is my new address for between");
// Directory containing many .docx documents.
document.Save();
Console.WriteLine("\tCreated: None\n");
Really Very simple.
Upvotes: 2
Reputation: 817
There is a solution on http://www.c-sharpcorner.com/UploadFile/Globalking/fileAccessingusingcsharp02242006050207AM/fileAccessingusingcsharp.aspx
Upvotes: 0