title: How to send a same reply mail (template saved in outlook) to the mail sender (to, cc)?
body: <p>I am receiving continues emails from customer (different customers) to update their asset details in database.. once process done .. I have to reply (including cc) from their mail telling like &quot;asset details successfully stored in Database&quot; (am using template) using VBA.</p>
  <pre><code>Option Explicit
  
  
  Public Sub ReplyToAll()
  
  Dim oExp As Outlook.Explorer
  
  'for selected mails in outlook
  
  Dim oSM As mailItem
  
  Dim oNM As mailItem
  
      On Error GoTo Err
      
      Set oExp = Outlook.Application.ActiveExplorer
      
      'Check if something is selected
      If oExp.Selection.Count &gt; 0 Then
          
          'Get the first item selected
  
          Set oSM = ActiveExplorer.Selection.Item(1)
          
              'Create a Reply template
  
              Set oNM = oSM.ReplyAll
              
              With oNM
                  
                  'Change the subject
                  .Subject = &quot;RE: &quot; &amp; oSM.Subject
                  
                  'Change the body
                  .Body = .Body &amp; Chr(13) &amp; Chr(13)
                  
              'Display the new mail before sending it
                  .Display
              
              End With
              
      End If
      
      Exit Sub
      
  Err:
      
      MsgBox Err.Description, vbCritical
      
  End Sub
  </code></pre>
  <p>section 3</p>
  <pre><code>Sub ReplyAll()
      Dim objOutlookObject As mailItem
      
  For Each objOutlookObject In GetCurrentOutlookItems
  
      With objOutlookObject
      .ReplyAll.Display
  'prob area code does not include the template saved in the location c ..throws some error
  
      .createitemtemplate(&quot;c:\car.jtm&quot;)
     End With
  Next
  End Sub
   
  Function GetCurrentOutlookItems() As Collection
      Dim objApp As Outlook.Application
      Dim objItem As Object
      Dim colItems As New Collection
          
      Set objApp = CreateObject(&quot;Outlook.Application&quot;)
      On Error Resume Next
      Select Case TypeName(objApp.ActiveWindow)
          Case &quot;Explorer&quot;
              For Each objItem In objApp.ActiveExplorer.Selection
                  colItems.Add objItem
              Next
          Case &quot;Inspector&quot;
              colItems.Add objApp.ActiveInspector.CurrentItem
          Case Else
              ' anything else will result in an error, which is
              ' why we have the error handler above
      End Select
      
      Set objApp = Nothing
      Set GetCurrentOutlookItems = colItems
  End Function
  </code></pre>