title: How to trap my reply to a Meeting Invite?
body: <p>When I reply to a meeting invite sent to one of my non-default email accounts, Outlook sends the replies from the default account instead of the account the invite was sent to.</p>
  <p>I tried using the <code>ItemLoad</code> event to trap this situation and set a <code>MailItem</code> object to use in a <code>MailItem.Reply</code> event. I get a type error message in this line of code below <code>Set NonDefaultMailboxMtgMsg = myObj</code>.</p>
  <p>How can I set <code>NonDefaultMailboxMtgMsg</code> to the meeting request's corresponding <code>MailItem</code> object so it will trigger the reply event?</p>
  <pre><code>Public WithEvents NonDefaultMailboxMtgMsg As MailItem
  Dim MeetingReplyDisplayName As String
  
  
  Private Sub Application_ItemLoad(ByVal Item As Object)
      
      Dim myObj As Variant
      Set myObj = GetCurrentItem()
        
      If myObj.Class = olMeetingRequest And myObj.Parent.Store.DisplayName _
       &lt;&gt; Application.GetNamespace(&quot;MAPI&quot;).GetDefaultFolder(olFolderInbox).Parent.Store.DisplayName Then
       
          Set NonDefaultMailboxMtgMsg = myObj
          MeetingReplyDisplayName = myObj.Parent.Store.DisplayName
      End If
  End Sub
  
  Private Sub NonDefaultMailboxMtgMsg_Reply(ByVal Response As Object, Cancel As Boolean)
          Response.SendUsingAccount = MeetingReplyDisplayName
  End Sub
  
  Function GetCurrentItem() As Object
      Dim objApp As Outlook.Application
           
      Set objApp = Application
      On Error Resume Next
      Select Case TypeName(objApp.ActiveWindow)
          Case &quot;Explorer&quot;
              Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
          Case &quot;Inspector&quot;
              Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
      End Select
       
      Set objApp = Nothing
  End Function
  </code></pre>