# GrapeCity.Documents.Excel.PrintOutOptions.PaperSourceName

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Excel_PrintOutOptions_PaperSourceName_" data-uid="GrapeCity.Documents.Excel.PrintOutOptions.PaperSourceName*">PaperSourceName Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Excel_PrintOutOptions_PaperSourceName_" data-uid="GrapeCity.Documents.Excel.PrintOutOptions.PaperSourceName*"></a>
<h4 id="GrapeCity_Documents_Excel_PrintOutOptions_PaperSourceName" data-uid="GrapeCity.Documents.Excel.PrintOutOptions.PaperSourceName">PaperSourceName</h4>
<div class="markdown level1 summary"><p>Gets or sets the name of the paper source (input tray) used for printing.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public string PaperSourceName { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Property PaperSourceName As String</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><p>The name of the paper source. The default is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>, which uses the printer's default tray.
The name must match one of the paper source names reported by the target printer driver (case-insensitive).</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Documents_Excel_PrintOutOptions_PaperSourceName_remarks">Remarks</h5>
<div class="markdown level1 remarks"><pre><code>&lt;p&gt;
</code></pre>
<p>Common paper source names include &quot;Tray 1&quot;, &quot;Tray 2&quot;, &quot;Bypass Tray&quot;, &quot;Auto Select&quot;, etc.
Available names vary by printer model and driver. You can query available paper sources
using <code>System.Drawing.Printing.PrinterSettings.PaperSources</code>.</p>

    <example>
<pre><code>    &lt;pre&gt;&lt;code class=&quot;lang-csharp&quot;&gt;PrintOutOptions options = new PrintOutOptions();
    options.ActivePrinter = &quot;HP LaserJet Pro&quot;;
    options.PaperSourceName = &quot;Tray 2&quot;;
    worksheet.PrintOut(options);&lt;/code&gt;&lt;/pre&gt;
&lt;/example&gt;
</code></pre>
</example></div>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
      <td><p>Thrown when the specified paper source name is not found for the target printer.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
