首页 > Web开发 > 详细

Aspose Example

时间:2014-03-05 15:50:38      阅读:567      评论:0      收藏:0      [点我收藏+]

官方使用说明(net)

http://www.aspose.com/docs/display/wordsnet/Find+and+Replace+Overview#FindandReplaceOverview-replace1

 

Aspose  dmeo

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using Aspose.Words;

 

namespace AsposeDemo

{

    class Program

    {

        static void Main(string[] args)

        {

            string tempPath = "temp.docx";

            string outPath = "new.docx";

            var doc = new Document(tempPath);

            //数据绑定到表格

            string[] fieldName = new string[] {"UserName","Gender","Birthday","Address" };

            object[] filedValues = new Object[] { "张三","男","1988-09-02","陕西咸阳"};

            doc.MailMerge.Execute(fieldName,filedValues);

            //替换书签内容

            var bookmark1 = doc.Range.Bookmarks["bookmark1"];

            bookmark1.Text = "test  bookmark";

            //查找替换

            doc.Range.Replace("myname","刘尚鑫",false,true);

            doc.Save(outPath);

            Console.WriteLine("OK");

            Console.ReadKey();

        }

    }

}

Aspose Example,布布扣,bubuko.com

Aspose Example

原文:http://www.cnblogs.com/liushangxin/p/3581152.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!