# C1.WPF.Excel.XLCommentCollection.Add

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_Excel_XLCommentCollection_Add_" data-uid="C1.WPF.Excel.XLCommentCollection.Add*">Add Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_Excel_XLCommentCollection_Add_" data-uid="C1.WPF.Excel.XLCommentCollection.Add*"></a>
<h4 id="C1_WPF_Excel_XLCommentCollection_Add_C1_WPF_Excel_XLComment_" data-uid="C1.WPF.Excel.XLCommentCollection.Add(C1.WPF.Excel.XLComment)">Add(XLComment)</h4>
<div class="markdown level1 summary"><p>Appends an <a class="xref" href="C1.WPF.Excel.XLComment.html">XLComment</a> object to the collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public XLComment Add(XLComment comment)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Add(comment As XLComment) As XLComment</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="C1.WPF.Excel.XLComment.html">XLComment</a></td>
      <td><span class="parametername">comment</span></td>
      <td><p>The <a class="xref" href="C1.WPF.Excel.XLComment.html">XLComment</a> object to add to the collection.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</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="C1.WPF.Excel.XLComment.html">XLComment</a></td>
      <td><p>A reference to the object if it was successfully added to the collection,
or null if the object could not be added to the collection (usually because it
overlaps another comment already in the collection).</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_Excel_XLCommentCollection_Add_" data-uid="C1.WPF.Excel.XLCommentCollection.Add*"></a>
<h4 id="C1_WPF_Excel_XLCommentCollection_Add_System_Int32_System_Int32_System_String_" data-uid="C1.WPF.Excel.XLCommentCollection.Add(System.Int32,System.Int32,System.String)">Add(int, int, string)</h4>
<div class="markdown level1 summary"><p>Creates an <a class="xref" href="C1.WPF.Excel.XLComment.html">XLComment</a> object and appends it to the collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public XLComment Add(int rowIndex, int colIndex, string author)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Add(rowIndex As Integer, colIndex As Integer, author As String) As XLComment</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.int32">int</a></td>
      <td><span class="parametername">rowIndex</span></td>
      <td><p>Index of the top row in the comment.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">colIndex</span></td>
      <td><p>Index of the left column in the comment.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">author</span></td>
      <td><p>The author of the comment.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</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="C1.WPF.Excel.XLComment.html">XLComment</a></td>
      <td><p>A reference to the object if it was successfully added to the collection,
or null if the object could not be added to the collection (usually because it
overlaps another comment already in the collection).</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_Excel_XLCommentCollection_Add_" data-uid="C1.WPF.Excel.XLCommentCollection.Add*"></a>
<h4 id="C1_WPF_Excel_XLCommentCollection_Add_System_Int32_System_Int32_System_String_System_String_" data-uid="C1.WPF.Excel.XLCommentCollection.Add(System.Int32,System.Int32,System.String,System.String)">Add(int, int, string, string)</h4>
<div class="markdown level1 summary"><p>Creates an <a class="xref" href="C1.WPF.Excel.XLComment.html">XLComment</a> object and appends it to the collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public XLComment Add(int rowIndex, int colIndex, string author, string text)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Add(rowIndex As Integer, colIndex As Integer, author As String, text As String) As XLComment</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.int32">int</a></td>
      <td><span class="parametername">rowIndex</span></td>
      <td><p>Index of the top row in the comment.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">colIndex</span></td>
      <td><p>Index of the left column in the comment.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">author</span></td>
      <td><p>The author of the comment.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">text</span></td>
      <td><p>The context of the comment.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</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="C1.WPF.Excel.XLComment.html">XLComment</a></td>
      <td><p>A reference to the object if it was successfully added to the collection,
or null if the object could not be added to the collection (usually because it
overlaps another comment already in the collection).</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_Excel_XLCommentCollection_Add_" data-uid="C1.WPF.Excel.XLCommentCollection.Add*"></a>
<h4 id="C1_WPF_Excel_XLCommentCollection_Add_System_Int32_System_Int32_System_String_System_String_System_Boolean_" data-uid="C1.WPF.Excel.XLCommentCollection.Add(System.Int32,System.Int32,System.String,System.String,System.Boolean)">Add(int, int, string, string, bool)</h4>
<div class="markdown level1 summary"><p>Creates an <a class="xref" href="C1.WPF.Excel.XLComment.html">XLComment</a> object and appends it to the collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public XLComment Add(int rowIndex, int colIndex, string author, string text, bool toRtf)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Add(rowIndex As Integer, colIndex As Integer, author As String, text As String, toRtf As Boolean) As XLComment</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.int32">int</a></td>
      <td><span class="parametername">rowIndex</span></td>
      <td><p>Index of the top row in the comment.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">colIndex</span></td>
      <td><p>Index of the left column in the comment.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">author</span></td>
      <td><p>The author of the comment.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">text</span></td>
      <td><p>The text of the comment.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">toRtf</span></td>
      <td><p>Flag indicating whether to convert <code class="paramref">author</code> and <code class="paramref">text</code> to RTF format.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</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="C1.WPF.Excel.XLComment.html">XLComment</a></td>
      <td><p>A reference to the object if it was successfully added to the collection,
or null if the object could not be added to the collection
(usually because it overlaps another comment already in the collection).</p>
</td>
    </tr>
  </tbody>
</table>
</div>
