Message-ID: <1093978836.2417.1710836241451.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2416_1161139875.1710836241451" ------=_Part_2416_1161139875.1710836241451 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 SharePoint View. A MailMerge by de= fault treats the page content as a repeat block, repeating the page content= for each row unless NEXT fields are used. If the WordTemplate.EnableNEXTFields property is= set to true, the NEXT field can also be used to indicate that the next row= of data should be inserted instead of the current row at the next occurenc= e of the merge fields.
=20public void SetMailMerge(this WordTemplate template, Microsoft.SharePoint.S= PList list, int maxRows)=20
Public Sub SetMailMerge(ByVal template As WordTemplate, ByVal list As Micro= soft.SharePoint.SPList, ByVal maxRows As Integer)=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 Exce= l 2003 binary template file type (.xls/.xlt), you can call SetMailMerge or = SetRepeatBlock, 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.<= /p>=20
Merge 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 SetDataSource include field names («fieldname») and field ordinals («#1»).
=20 =20 =20//--- Set the mail merge //--- The data source is the SharePoint List myList //--- MaxRows is set to ALL_ROWS, which allows all rows to be imp= orted wt.SetMailMerge(myList, WordTemplate.ALL_ROWS); wt.Process();=20
'--- Set the mail merge '--- The data source is the SharePoint List myList '--- MaxRows is set to ALL_ROWS, which allows all rows to be impo= rted wt.SetMailMerge(myList, WordTemplate.ALL_ROWS) wt.Process()=20