tab 1
此 demo 展示如何使用邮件合并填充数据到 word 模板。
如果这不是您想要的 demo,您可以通过填写表格获取免费定制 demo。
如您有与我们产品相关的其他技术问题,请联系 该email地址已收到反垃圾邮件插件保护。要显示它您需要在浏览器中启用javascript。;销售相关的问题,请联系 该email地址已收到反垃圾邮件插件保护。要显示它您需要在浏览器中启用javascript。。
tab 2
using system;
using spire.doc;
namespace demoonlinecode
{
class mailmerge
{
public void demomailmerge(string docfile)
{
document document = new document(docfile, fileformat.auto);
string[] values = {
datetime.today.addyears(-5).tostring("yyyy-mm-dd"),
datetime.today.addyears(5).tostring("yyyy-mm-dd"),
datetime.today.addyears(6).tostring("yyyy-mm-dd"),
datetime.today.addyears(-2).tostring("yyyy-mm-dd"),
datetime.today.addyears(2).tostring("yyyy-mm-dd")
};
string[] fields = {
"subgrantpastartdatevalue",
"subgrantpaenddatevalue",
"subgrantpaextensiondatevalue",
"subgrantpsstartdatevalue",
"subgrantpsenddatevalue"
};
document.mailmerge.execute(fields, values);
document.savetofile("demo.doc", fileformat.doc);
}
}
}
tab 3
imports spire.doc
namespace demoonlinecode
class mailmerge
public sub demomailmerge(docfile as [string])
dim document as new document(docfile, fileformat.auto)
dim values as string() = {
datetime.today.addyears(-5).tostring("yyyy-mm-dd"),
datetime.today.addyears(5).tostring("yyyy-mm-dd"),
datetime.today.addyears(6).tostring("yyyy-mm-dd"),
datetime.today.addyears(-2).tostring("yyyy-mm-dd"),
datetime.today.addyears(2).tostring("yyyy-mm-dd")
}
dim fields as string() = {
"subgrantpastartdatevalue",
"subgrantpaenddatevalue",
"subgrantpaextensiondatevalue",
"subgrantpsstartdatevalue",
"subgrantpsenddatevalue"
}
document.mailmerge.execute(fields, values)
document.savetofile("demo.doc", fileformat.doc)
end sub
end class
end namespace