Message-ID: <2067456247.7649.1711616920103.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_7648_1164264352.1711616920103" ------=_Part_7648_1164264352.1711616920103 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Sets the MailMerge's data source to a two-dimensional (rectangular) arra= y of objects. A MailMerge by default treats the page content as a repeat bl= ock, repeating the page content for each row unless NEXT fields are used. I= f the WordTemplate.E= nableNEXTFields property is set to true, the NEXT field can also be use= d to indicate that the next row of data should be inserted instead of the c= urrent row at the next occurence of the merge fields. This should largely i= mitate the behavior of a Microsoft Word Mail merge.
=20public void SetMailMerge(System.Collections.IEnumerator dataSource)=20
Public Sub SetMailMerge(ByVal dataSource As System.Collections.IEnumerator)=20
null
(C#) or=20
Nothing
(VB.NET) is passed to the method.=20
You can call SetMailMerge once for each instance of WordTemplate. If you are using the Word= 2003 binary template file type (.doc/.dot), you can call SetMailMerge or S= etRepeatBlock, but not both.
=20Additionally, only the page content is repeated for each row, not the en= tire page itself. If you wish to have the page itself repeat for each row, = you will need to remember to place a page break at the bottom of the page. = Alternatively, you can create a hidden page break at the top of the page as= follows:
=20Merge Fields for using the SetMailMerge method must not specify a data s= ource =E2=80=93 the data source is implied, and using a data source name wi= ll cause WordTemplate to throw an error. Valid merge field formats for use = with SetMailMerge include field names («fieldname») and field ordinals («#1»).
=20SetM= ailMerge will now work with headers and footers. A section break is req= uired instead of a page break if each header or footer will be different.= p>=20
wt.SetMailMerge(coll);=20
wt.SetMailMerge(coll)=20