Have a MAPI service provider that provides custom folder view in Outlook, works fine in Outlook 2010 64-bit. In Outlook 2013 64-bit and later it fails to open the folders with error Cannot expand the folder. No description is available for this error.
However if Outlook 2013+ is launched via a PowerShell script like below, the folders work:
Add-type -Assembly "Microsoft.Office.Interop.Outlook" | out-null
$olFolders = "Microsoft.Office.Interop.Outlook.olDefaultFolders" -as [type]
$outlook = New-Object -ComObject Outlook.Application
$namespace = $outlook.GetNameSpace("MAPI")
$folder = $namespace.GetDefaultFolder($olFolders::olFolderInbox)
$folder.Display()
Currently I am doing an analysis of what is different using Process Monitor, Rohitab API Monitor and Windbg when Outlook is opened these ways.
However I am interested to know if anybody knows what is different between Outlook startup process when launched via shortcut vs automation that may impact MAPI service provider working correctly.