Aspose.words 替换字符 操作

mac2022-06-30  12

var path = Server.MapPath("~/doc/demo.doc"); Document doc = new Document(path); DocumentBuilder builder = new DocumentBuilder(doc); //builder.Write("张三"); // var repStr = string.Format("&{0}&", "[客户姓名]"); doc.Range.Replace("[客户姓名]", "张三", false, true); doc.Range.Replace("[姓名]", "李四", false, true); doc.Range.Replace("[性别]", "男", false, true); doc.Range.Replace("[年龄]", "18", false, true);

doc.Save(path);

转载于:https://www.cnblogs.com/90nice/p/4644326.html

相关资源:aspose.words 16.7.0 破解版(去水印不限制大小)
最新回复(0)