Retrieve a shared inbox in Outlook

16 visualizaciones (últimos 30 días)
Noah Walcutt
Noah Walcutt el 12 de Jun. de 2019
Respondida: Noah Walcutt el 13 de Jun. de 2019
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''

Respuestas (1)

Noah Walcutt
Noah Walcutt el 13 de Jun. de 2019
Here is the solution I found:
INBOX = mapi.Folders.Item(1).Folders.Item('Inbox').Folders.Item(n).Folders.Item(nn).Folders.Item(nnn);

Categorías

Más información sobre Standard File Formats en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by