Adam Ehrenworth
asked on
VBA - Get EntryID of Outlook Message that is Open (versus selected)
I have the following piece of code that is getting the EntryID of an Outlook message that is selected. However, I want to have a button to execute this script on the custom toolbar of the message itself,
How I get the Entry ID of the currently "open" message ID versus a highlighted one?
How I get the Entry ID of the currently "open" message ID versus a highlighted one?
Set currentExplorer = Application.ActiveExplorer
Set Selection = currentExplorer.Selection
For Each currentItem In Selection
If currentItem.Class = olMail Then
Set currentMail = currentItem
End If
Next
strEntryID = currentMail.entryID
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Was able to just use this code on the main screen versus on the open mail.
ALT f11
insert this in a module for macros
open a message (it will not open it for you to install the toolbar, but you can add it, or i can)
run the part that install the toolbar and button (test sub)
NOTE: this is an old method to install buttons, normally you would generate a xml file with a new ribbon
click the button inside the message
Tested in outlook 2013
Open in new window