title: How to tag recipients in Outlook mail body via VBA?
body: <p>In Outlook, you have the option to tag a recipient using <code>@'required emailid'</code> in the mail body. Email will be highlighted for all tagged recipients.</p>
  <p>I have 2 columns in Excel.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>A</th>
  <th>B</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>@user1, @user2</td>
  <td>sit</td>
  </tr>
  <tr>
  <td>@user3, @user1</td>
  <td>stand</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I want these values to be read from Excel and create a text string and put on mail body, like:</p>
  <blockquote>
  <p>@User1, @User2. Please sit<br />
  @user3, @User1. Please stand.</p>
  </blockquote>
  <p>where each userid is tagged/linked.</p>
  <p>Below is the code that I have tried. It is pasting the '@User1' etc. as simple text and not as tags-</p>
  <pre><code>Sub send_mail_test()
  
      Set wb = ActiveWorkbook
      Set sh = ActiveSheet
          
      un = Application.UserName
      rr = Cells(1, 1).End(xlDown).row
          
      Subj = &quot;This is a test mail&quot;
      
      body = &quot;&lt;p&gt;&quot; &amp; &quot;Hi All,&quot; &amp; &quot;&lt;/p&gt;&quot; &amp; _
      &quot;&lt;p&gt;&quot; &amp; &quot;Below is the list of tasks - &quot; &amp; &quot;&lt;/p&gt;&quot; &amp; _
      &quot;&lt;p&gt;&quot; &amp; &quot;Action Items - &quot; &amp; &quot;&lt;br /&gt;&quot; &amp; &quot;&lt;ol&gt;&quot;
      
      For i = 2 To rr
          If Cells(i, 1) &lt;&gt; &quot;&quot; Then
              body = body &amp; &quot;&lt;li&gt;&quot; &amp; sh.Cells(i, 1).Value &amp; &quot;. Please - &quot; &amp; sh.Cells(i, 2) &amp; &quot;&lt;/li&gt;&quot;
          End If
      Next i
      
      body = body &amp; &quot;&lt;/ol&gt;&quot; &amp; &quot;&lt;/p&gt;&quot; &amp; _
              &quot;&lt;p&gt;&quot; &amp; &quot;Thanks,&quot; &amp; &quot;&lt;br /&gt;&quot; &amp; un &amp; &quot;&lt;/p&gt;&quot;
          
      ' SET Outlook APPLICATION OBJECT.
      Dim objOutlook As Object
      Set objOutlook = CreateObject(&quot;Outlook.Application&quot;)
      
      ' CREATE EMAIL OBJECT.
      Dim objEmail As Object
      Set objEmail = objOutlook.CreateItem(olMailItem)
  
      With objEmail
          .To = &quot;ABC@XYZ.COM&quot;
          .Cc = &quot;ABC@XYZ.COM&quot;
          .Subject = Subj
          .HTMLbody = body
          .Display        ' DISPLAY MESSAGE.
      End With
      
      ' CLEAR.
      
      Set objEmail = Nothing:    Set objOutlook = Nothing
  End Sub
  
  </code></pre>