How I could set up a listener and for an event (new email in my mailbox) in Outlook with MATLAB?
조회 수: 2 (최근 30일)
이전 댓글 표시
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
채택된 답변
Mario Malic
2021년 5월 31일
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
Elisa Hid
2021년 12월 30일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Web Services에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!