I am generally decent with using VBA with the exception of Outlook. I am wanting to convert one of my "Quick Steps" to a macro, to which I will then assign it to a Quick Access Toolbar (QAT) button. The reason for this is that I use this quick step very frequently throughout the workday and deal with a lot of attachments, and when selecting an attachment the ribbon changes from the 'home' tab to the 'attachment' tab within the email - making this quick step slightly less "quick" as I have to now click on the home tab again.
I am needing a way for the macro to first establish where it was called from (whether from Outlook main application or from an open email) then assign the message to an obj variable to allow me to manipulate it the way the quick step does.
1.) How do I allow the macro to determine whether it was called from the Outlook app?
1a.) I shouldn't have an issue assigning the selected message to a mail obj variable, but feel free to share some insight if you wish as I am mostly unfamiliar with Outlook object model.
2.) How do I allow the macro to determine if it is being called from an open mail object?
2a.) How do I assign this particular mail object to a variable? Is Application.ActiveInspector.CurrentItem the appropriate way to accomplish this, or is there a better way to get the caller's object? Application.Caller doesn't appear to be a thing in Outlook.
The reasoning being parts 1 & 2 is to allow me to use the macro regardless if it's being called from the main program or from within the email.
I am using Outlook 2016 if that helps.
I greatly appreciate any assistance on this!