Retrieve a shared inbox in Outlook
Afficher commentaires plus anciens
Hello! First time Outlook COM user. I have code to load the default outlook inbox in MATLAB, but I would like to download email from a shared outlook inbox. Here is the code to view email from the default inbox:
outlook = actxserver('Outlook.Application');
mapi = outlook.GetNamespace('mapi');
INBOX = mapi.GetDefaultFolder(6); % inbox items, I think this is the line I need to change?
email = INBOX.Items.Item(1);
inbox.Subject{i} = email.get('Subject');
I also have a way to view the shared inbox content using windows PowerShell:
Add-Type -assembly "Microsoft.Office.Interop.Outlook"
$Outlook = New-Object -comobject Outlook.Application
$namespace = $Outlook.GetNameSpace("MAPI")
$namespace.Folders(1).Folders.Item('Inbox').Folders.Item('Elwha').Items
But when I try 'INBOX = mapi.Folders(1).Folders.Item('Inbox').Folders.Item('Elwha').Items' in MATLAB, I get the error message 'Undefined function or variable 'Folders''
Réponses (1)
Noah Walcutt
le 13 Juin 2019
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!