How I could set up a listener and for an event (new email in my mailbox) in Outlook with MATLAB?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dimitrios Poulos
el 31 de Mayo de 2021
Comentada: Elisa Hid
el 30 de Dic. de 2021
I need to listen the mails (of my Outlook mailbox) and if a new mail comes in my mailbox to trigger a function.
Thanks
0 comentarios
Respuesta aceptada
Mario Malic
el 31 de Mayo de 2021
Hey,
When numUnreads changes, you can run your function.
hOutlook = actxserver('Outlook.Application');
nameSpace = hOutlook.GetNamespace("MAPI");
inboxFolder = nameSpace.GetDefaultFolder(6); % https://docs.microsoft.com/en-us/office/vba/api/outlook.oldefaultfolders
numUnreads = inboxFolder.UnReadItemCount
5 comentarios
Elisa Hid
el 30 de Dic. de 2021
I am unsure about how I should proceed with this, as I am not familiar with events and listeners. As far as I understood, the event is triggered when a property of a handle class (using the handle class notify method) changes. So where exactly should your code snippet be placed? Under the properties block of the class definition? Thanks in advance
Más respuestas (0)
Ver también
Categorías
Más información sobre Web Services en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!