# GrapeCity.Documents.Word.Templates.DataTemplate.BatchProcess

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Word_Templates_DataTemplate_BatchProcess_" data-uid="GrapeCity.Documents.Word.Templates.DataTemplate.BatchProcess*">BatchProcess Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Word_Templates_DataTemplate_BatchProcess_" data-uid="GrapeCity.Documents.Word.Templates.DataTemplate.BatchProcess*"></a>
<h4 id="GrapeCity_Documents_Word_Templates_DataTemplate_BatchProcess_System_Action_System_Globalization_CultureInfo_" data-uid="GrapeCity.Documents.Word.Templates.DataTemplate.BatchProcess(System.Action,System.Globalization.CultureInfo)">BatchProcess(Action, CultureInfo)</h4>
<div class="markdown level1 summary"><p>Iterates over root items in <a class="xref" href="GrapeCity.Documents.Word.Templates.DataTemplate.DataSources.html#GrapeCity_Documents_Word_Templates_DataTemplate_DataSources">DataSources</a>,
starting with a fresh copy of the document and processing templates separately
for each root data item.</p>
<p>
The <code class="paramref">itemProcessed</code> action is called as each data item is processed.
This action can be used to save the current version of the document (containing data
only from the current root data item).
</p>
<p>
When this method completes, the document is restored to the original state
(i.e. it will contain the original template tags rather than data values).
</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void BatchProcess(Action itemProcessed, CultureInfo cultureInfo = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub BatchProcess(itemProcessed As Action, Optional cultureInfo As CultureInfo = Nothing)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a></td>
      <td><span class="parametername">itemProcessed</span></td>
      <td><p>The action to be invoked after each root data item is processed.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo">CultureInfo</a></td>
      <td><span class="parametername">cultureInfo</span></td>
      <td><p>Culture used to format data values. If null, the current culture is used.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Documents_Word_Templates_DataTemplate_BatchProcess_System_Action_System_Globalization_CultureInfo__seealso">See Also</h5>
<div class="seealso">
    <div><a class="xref" href="GrapeCity.Documents.Word.Templates.DataTemplate.Process.html#GrapeCity_Documents_Word_Templates_DataTemplate_Process_System_Globalization_CultureInfo_">Process</a>(<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo">CultureInfo</a>)</div>
</div>
</div>
