您的位置:首页 > 编程语言 > ASP

Aspose.words 替换字符 操作

2015-07-14 01:09 786 查看
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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: