Word Open XML邮件合并 [英] Word Open XML Mail Merge
问题描述
我正在尝试使用Word的XML(来自Word 2007)手动创建邮件合并.我有以下无法使用的XML:
I'm attempting to manually create a mail merge using Word's XML (from Word 2007). I have the following XML which isn't working:
<w:mailMerge>
<w:mainDocumentType w:val="catalog" />
<w:linkToQuery />
<w:dataType w:val="native" />
<w:connectString w:val="Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=TheServer;Data Source=." />
<w:query w:val="SELECT * FROM `Table` WHERE `id_field` = 7" />
<w:dataSource r:id="rId1" />
<w:activeRecord w:val="0" />
</w:mailMerge>
我真的无法从文档中弄清楚我该怎么做.这只是来自数据库表的邮件合并.它说<w:mainDocumentType w:val="catalog" />
行上有错误.我没有任何运气就查找了w:val
的可能值.我找不到任何合适的文档.
I can't really figure out from the documentation what I'm supposed to do. This is just a mail merge from a database table. It says there's an error on the line <w:mainDocumentType w:val="catalog" />
. I've looked up possible values of w:val
without any luck. I can't find any decent documentation on it.
有人有什么主意吗?
推荐答案
DII 具有所有文档,您也可以在此站点上查找,例如mainDocumentType
被列为
DII has all of the documentation and you can also look up on this site, like the mainDocumentType
is listed as a CT_MailMergeDocType
. Upon searching for that, I get which then tells me to look up ST_MailMergeDocType
, where it lists the types.
此外,OpenXML Developer对于MailMerge和WordprocessingML具有一些基本的介绍性文章:
Also, OpenXML Developer has some basic intro articles to MailMerge with WordprocessingML:
- Mail merge in WordProcessingML using System.IO.Packaging API
- Mail Merge in WordProcessingML
这篇关于Word Open XML邮件合并的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!