如果邮件不是它自己的窗口(即在Outlook中),则我无法弄清楚如何为正在编写的活动邮件设置MailItem
变量。我见过several answers,它解释了如何将变量设置为这样的打开窗口:
Dim theEmail As MailItem, oInspector As Inspector
Set oInspector = Application.ActiveInspector
Set theEmail = oInspector.CurrentItem
这在消息草稿是新窗口的情况下非常有用。但是,如果草稿在Outlook中,则此方法现在可行。如何引用不是新窗口的有效草稿?
[我看过一些帖子都说Set theEmail = ActiveExplorer.Selection.Item(1)
,但这引用的是收到回复的邮件,而不是答复的草稿。
谢谢。
使用Explorer.ActiveInlineResponse
。可以从Application.ActiveExplorer
中检索资源管理器。