title: Using VBA in Outlook to Send Texts with Emojis
body: <p>I have some VBA code that I'm using to send texts from Outlook to team members of my project at work.  For some background: for non-AT&amp;T subscribers, we have no issue sending text messages from Outlook by plugging in peoples' numbers en masse into the To: field of Outlook emails.  However, all AT&amp;T subscribers will receive the text as a group message, which we want to avoid.  The non-AT&amp;T subscribers correctly receive individual texts when we do a group send.</p>
  
  <p>We've written some VBA code to loop through a spreadsheet of AT&amp;T numbers so that Outlook sends one email per AT&amp;T number.  This has been working fine for us, however, we were hoping to add some emojis into the texts that we're sending.  I've done a lot of Googling and searching through stackoverflows questions, and I can't seem to find any code built for this purpose.  I'm also a complete noob when it comes to VBA, and I've pieced this solution together thus far from getting help from a coworker and reading through threads on the internet.  This bit about emojis has given me enough trouble that I thought I'd break down and submit this post.</p>
  
  <p>For reference, here is my code:</p>
  
  <pre><code>Sub EmojiTest()
      Dim objOutlook As Outlook.Application
      Dim objOutlookMsg As Outlook.MailItem
      Dim objOutlookRecip As Outlook.Recipient
      Dim MobileNumber As String
  
        ' Create the Outlook session.
        Set objOutlook = CreateObject("Outlook.Application")
        Set xlApp = CreateObject("Excel.Application")
  
        'Grab list from Excel
        Set xlAtt = xlApp.Workbooks.Open("C:\Users\Username\Desktop\Spreadsheet with AT&amp;T numbers.xlsx")
        xlAtt.Activate
        LastRow = xlAtt.ActiveSheet.Range("B" &amp; xlAtt.ActiveSheet.Rows.Count).End(-4162).Row
  
        For i = 1 To LastRow
          xlAtt.Activate
          MobileNumber = xlAtt.ActiveSheet.Range("B" &amp; i).Value
  
          ' Create the message.
          Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
  
          objOutlookMsg.SentOnBehalfOfName = "TeamAccount@work.com"
  
          With objOutlookMsg
              ' Add the To recipient(s) to the message.
              Set objOutlookRecip = .Recipients.Add(MobileNumber)
              objOutlookRecip.Type = olTo
  
              ' Set the Subject, Body, and Importance of the message.
              .Subject = "Emoji Test"
              .Body = "Text with emojis"
              .Save
              .Send
          End With
        Next i
        Set objOutlook = Nothing
        xlApp.Workbooks.Close
        Set xlApp = Nothing
  End Sub
  </code></pre>
  
  <p>This is code I never could have come up with myself due to my complete lack of experience with VBA, and limited experience coding in general.  Any help is much appreciated.</p>