Hello guys,
I'm trying to replace people at my work and the next step is running specific macros when certain emails are received.
I am using office 365, and I'm not sure what is going wrong.
I found multiple examples, but none of them seem to work, an example: https://docs.microsoft.com/en-us/office/vba/api/outlook.application.newmail
But once run i get the compile error: user-defined type not defined
The error seems to originate from:
Public WithEvents myOlApp As Outlook.Application
and I have no practice with working with applications that are outside excel, any help is much appreciated!
https://www.tachytelic.net/2017/10/how-to-run-a-vba-macro-when-new-mail-is-received-in-outlook/
This would get me all the info i need, but i cannot get it to work either, really not sure what im missing
I'm trying to replace people at my work and the next step is running specific macros when certain emails are received.
I am using office 365, and I'm not sure what is going wrong.
I found multiple examples, but none of them seem to work, an example: https://docs.microsoft.com/en-us/office/vba/api/outlook.application.newmail
But once run i get the compile error: user-defined type not defined
The error seems to originate from:
Public WithEvents myOlApp As Outlook.Application
and I have no practice with working with applications that are outside excel, any help is much appreciated!
https://www.tachytelic.net/2017/10/how-to-run-a-vba-macro-when-new-mail-is-received-in-outlook/
This would get me all the info i need, but i cannot get it to work either, really not sure what im missing
Last edited: