Link to home
Start Free TrialLog in
Avatar of hke72
hke72Flag for Norway

asked on

Catch the current mailitem in Outlook

I am trying to find a way to do the equivalent to Currentproject/ActiveDocument in Outlook. I want to open a new e-mail, run my code which then changes my active e-mail in some ways (e.g. shows the from-field).
Avatar of David Lee
David Lee
Flag of United States of America image

Hi, hke72.

The statement

    objMsg = Outlook.Application.ActiveInspector.CurrentItem

will get you the currently open message.
Avatar of hke72

ASKER

But how can I run it? I am trying to use the code on an open e-mail. I want to put some predefined facts into the e-mail. If I push Alt+F11 in outlook I get  "This Outlook session". But this code could only be run from the Outlook window?
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hke72

ASKER

Thank you!
You're welcome.