Open outlook in specific folder

so i found this piece of code

(new-object -com Outlook.Application).GetNamespace("MAPI").GetDefaultFolder("olFolderInbox").GetExplorer().Display()

to open me outlook.

i just want that it doesnt open in one of the many default folders but in one specific mailbox of mine, lets call it “systemmails”

how can i do that ? thanks a lot

Hi, welcome to the forum :wave:

$outlook = New-Object -ComObject Outlook.Application
$mapi = $outlook.GetNamespace('MAPI')
$folder = $mapi.Folders.Item('systemmails')
$folder.GetExplorer().Display()

I recommend using Get-Member to explore the $outlook, $mapi, and $folder variables as it will show you the properties and methods you can use to access the various items.

1 Like