- Code: Select all
Document document = new Document();
document.LoadFromFile(@"E:\Work\Documents\WordDocuments\New Zealand.docx");
document.Replace("Peter", "Sam", true, true);
document.SaveToFile("Replace.docx", FileFormat.Docx);
我想要的是以下為文件內容範例
The soup is so...that hot that Peter and Peter
Hi Peter is very good
我只想要將段落1 所有的Peter 換成 Sam 但段落2的Sam 不要被替換到 如下方範例
The soup is so...that hot that Sam and Sam
Hi Peter is very good
請問可以做到嗎?