1

How do I set a MailItem variable to an active message being composed, if the message is not in its own window (i.e. within Outlook).

I have seen several answers that explain how to set the variable to an open window such as this:

Dim theEmail As MailItem, oInspector As Inspector
Set oInspector = Application.ActiveInspector
Set theEmail = oInspector.CurrentItem

This works when a message draft is a window not if the draft is within Outlook.

How can I reference an active draft that is not a new window?

I've seen posts saying Set theEmail = ActiveExplorer.Selection.Item(1) however this references the received message being replied to, not the draft of the reply.

Community
  • 1
  • 1
pgSystemTester
  • 8,979
  • 2
  • 23
  • 49

1 Answers1

2

Use Explorer.ActiveInlineResponse. Explorer can be retrieved from Application.ActiveExplorer.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • 1
    That's what I needed. For anyone looking for a signle line... this will do it: `Set aMail = Application.ActiveExplorer.ActiveInlineResponse` – pgSystemTester Jan 24 '20 at 17:29