XWPFDocument fileWord = null;
fileWord = new XWPFDocument("要打开的word文件");
foreach (var search in fileWord.Paragraphs)
{
string searchText = search.Text;
if (searchText == "你要查找的段落")
{
string newText = text.Replace("你要查找的段落", "你要替换的段落");
search.ReplaceText(searchText, newText);
}
}
08-30
1595
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-20