New Outlook mode - how to get the imap accounts with AppleScript?

I like to get the imap accounts from outlook with AppleScript

tell application "Microsoft Outlook"
	try
		name of every imap account
	end try
end tell

But this code works only if the “new Outlook” design option is switched off.

Is the a new way to get the accounts or is this feature not implemented ?

Same with Apple M1 on 11.5.2 or Mac Intel with 10.14.6

Outlook 16.54

Armin

I’ve read that Applescript doesn’t work in the “new Outlook” but continues to work in the old version. Also, that they haven’'t yet decided whether to support Applescript in the “new Outlook”.

Nothing serious to offer on any Outlook newer than 2011 but try removing the ‘try’ statements as they block whatever error message might show up to give insight into the problem. Once you have working code you can rework them into it.

Regarding outlook… assuming it does work with ‘new’, then maybe try and work your way backwards, e.g. start with ‘accounts’, ‘imap accounts’, then ‘name of imap accounts’ and see if anything gets you the results you need.