Message-ID: <1784909728.9903.1711706299091.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_9902_17994444.1711706299091" ------=_Part_9902_17994444.1711706299091 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html SharePointIntegration.SetRepeatBlock(WordTemplate, Microsoft.Sha= rePoint.SPView, Microsoft.SharePoint.SPList, String)

SharePointIntegration.SetRepeatBlock(WordTemplate, Microsoft.ShareP= oint.SPView, Microsoft.SharePoint.SPList, String)

Introduced in build 4.1.0.1379

<= /span>=20

Description=20

Sets the specified repeat block's data source to a SharePoint View.

= =20
C#
=20
<p>public static void SetRepeatBlock(this WordTemplate template, Micr=
osoft.SharePoint.SPView view, Microsoft.SharePoint.SPList list, string book=
mark)</p>
=20
=20
vb.net
=20
<p>Public Shared Sub SetRepeatBlock(ByVal template As WordTemplate, B=
yVal view As Microsoft.SharePoint.SPView, ByVal list As Microsoft.SharePoin=
t.SPList, ByVal bookmark As String)</p>
=20
=20

Parameters=20

template
Th= e current WordTemplate object calling SetRepeatBlock=20
view
The ShareP= oint View to use as the data source.=20
list
The ShareP= oint List to which the View applies.=20
bookmark
=20

The bookmark name of the template repeat block. The bookmark passed to <= code>SetRepeatBlock must exist in the template Word file. To see a l= ist of template bookmark names:

=20
    =20
  1. Open the template in Microsoft Word.
  2. =20
  3. Open the Edit menu.
  4. =20
  5. Select Go To...
  6. =20
  7. Select Bookmark.
  8. =20
  9. Under Enter bookmark name, open the drop-down list of = bookmark names.
  10. =20
=20

Exceptions=20

Arg= umentNullException
=20 SetRepeatBlock will throw this exception if=20 null (C#) or=20 Nothing (VB.NET) is passed to the method.=20
Argumen= tException
=20

Remarks

=20

A repeat block is a fragment in the template document that will be repea= ted for each row in a data source. In the template document, repeat blocks = are defined by Word bookmarks that contain merge fields.

=20

You can call SetRepeatBlock several times for a single instance of WordTemplate. The = repeat block specified by the parameter bookmark must exist in= the template.

=20
=20 Icon=20
=20

This is an extension method for the WordTemplate object to be used for b= inding SharePoint data to applications from within SharePoint. To use this = method, you must add a reference to SoftArtisans.OfficeWriter.WordWriter.Sh= arePointIntegration.dll

=20
=20
=20

Examples

=20
C#
=20

          //--- Set a data source for the repeat block
          //--- defined by the bookmark "Page"
          //--- "myView" is the SharePoint View containing the da=
ta to be
          //--- imported and repeated in the repeat block
          oWW.SetRepeatBlock(myView, myList, "Page");
          oWW.Process();
        
=20
=20
vb.net
=20

          '--- Set a data source for the repeat block
          '--- defined by the bookmark "Page"
          '--- "myView" is the SharePoint View containing the dat=
a to be
          '--- imported and repeated in the repeat block
          oWW.SetRepeatBlock(myView, myList, "Page")
          oWW.Process()
        
=20
------=_Part_9902_17994444.1711706299091--