.net根据模板生成Word文件

 word的模板文档

                                                       
个人资料详情

 

客户名称:<$namefull$>

 

手机:<$mobile$>

 

联系人名称:<$contactman$>

 

详细地址:<$address$>

 

电子邮件:<$email$>

 

 

省份:<$province$>

 

 



C#代码
                     string  strtext  =   " <$namefull$> " ;
                    
string  ReplaceStr  =  namefull;
                    test.ReplaceText(strtext, ReplaceStr);

                    
string  strtext1  =   " <$contactman$> " ;
                    
string  ReplaceStr1  =  contactman;
                    test.ReplaceText(strtext1, ReplaceStr1);

                    
string  strtext2  =   " <$email$> " ;
                    
string  ReplaceStr2  =  email;
                    test.ReplaceText(strtext2, ReplaceStr2);

                    
string  strtext3  =   " <$address$> " ;
                    
string  ReplaceStr3  =  address;
                    test.ReplaceText(strtext3, ReplaceStr3);

                    
string  strtext4  =   " <$mobile$> " ;
                    
string  ReplaceStr4  =  mobile;
                    test.ReplaceText(strtext4, ReplaceStr4);

                    
string  strtext5  =   " <$province$> " ;
                    
string  ReplaceStr5  =  province;
                    test.ReplaceText(strtext5, ReplaceStr5);


生成以后的word文档


                                                                个人资料详情

 

客户名称:南沙联发食品有限公司

 

手机:13024128888

 

联系人名称:李仲煌

 

详细地址:进港路合成工业区

 

电子邮件:zhen3d@aee.com

 

 

省份:广东

 

 

 




完整实例下载

/Files/mextb1860/excelApp.rar
/Files/mextb1860/WordApplication_demo.zip

如果代码要正常运行.必须安装office.有问题再联系
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值