Retrieve a shared inbox in Outlook
20 views (last 30 days)
Show older comments
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''
0 Comments
Answers (1)
See Also
Categories
Find more on Standard File Formats in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!