C# to replace strings of text in a docx

£可爱£侵袭症+ 提交于 2019-12-09 17:48:38

问题


Using C#, is there a good way to find and replace a text string in a docx file without having word installed on that machine?


回答1:


Yes, using Open XML. Here's an article which addresses your specific question: Creating a Simple Search and Replace Utility for Word 2007 Open XML Format Documents




回答2:


You may also try Aspose.Words for .NET in order to find and replace text in Word document. This component doesn't require MS Office to be installed. The API is quite simple and easy to use and implement.

Disclosure: I work as developer evangelist at Aspose.



来源:https://stackoverflow.com/questions/3375811/c-sharp-to-replace-strings-of-text-in-a-docx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!