title: vba outlook - reply from a file from a folder
body: <p>I dragged an outlook msg to a specific folder named "email temp folder" and would like to reply on that msg automatically.</p>
  
  <p>The title name of the msg which I saved in "email temp folder" could be anything. It is not possible for me to get the file's title name. So I try to loop through the file in "email temp folder" and <code>Set FileItemToUse = objFile</code> </p>
  
  <p>However, there is an error: object doesn't support this property or method on this line. <code>.ReplyAll</code></p>
  
  <p>How am I able to turn <code>FileItemToUse</code> into an outlook item?</p>
  
  <pre><code>Sub outlookActivate1()
  
    Dim OutApp As Outlook.Application
    Dim OutMail As Outlook.MailItem
    Dim fso As New FileSystemObject
    Dim objFolder As Object
    Dim objFile As Object
    Dim FileItemToUse As Object
    Dim i As Long
  
    Set OutApp = CreateObject("Outlook.Application")
  
    strPath = "C:\Users\admin\Desktop\email temp folder" &amp; "\"
    strFiles = Dir(strPath &amp; "*.*")
    Set objFolder = fso.GetFolder(strPath)
  
    For Each objFile In objFolder.Files 
  
      If i = 0 Then    
        Set FileItemToUse = objFile           
      End If
  
    Next objFile
  
  
    With FileItemToUse
  
      .ReplyAll
      .BCC = ""
      .Subject = "Hi"
      .HTMLBody = "testing"
      .BodyFormat = olFormatHTML
      .display
  
    End With
  
    Set OutMail = Nothing
    Set OutApp = Nothing
  
  End Sub
  </code></pre>