0

In preservation of my privacy I wanted to be able to create a hidden folder in my outlook client so that my co-workers can't go through my private/confidential e-mails.

So far I managed to create the file itself, but I was wondering if it is possible to make it "invisible", if so, how?

here's my code so far:

$ol = New-Object -ComObject Outlook.Application
$ns = $ol.GetNamespace("MAPI")

$in = $ns.GetDefaultFolder([Microsof.Office.Interop.Outlook.OlDefaultFolders]::olFolderInbox)
$nf = $in.Folders.Add("HideMe")

thank you ;)

Community
  • 1
  • 1
Tom Kustermans
  • 521
  • 2
  • 8
  • 31
  • You could create a separate PST file and put your folder in it. Then only open the PST file when you have control of your computer. Close the file when you leave the computer unattended. And put the PST file in a non-obvious folder. – Χpẘ Mar 01 '16 at 04:52
  • not really how I pictured this. I wanna keep it simple and be able to use this in the outlook client anywhere with this account so basically I'm wondering if there's a `Hidden`-or `Visible`-like field I can set so that it doesn't show? – Tom Kustermans Mar 01 '16 at 07:27

1 Answers1

0

Two options:

  1. Create a folder and set the PR_ATTR_HIDDEN MAPI property (DASL name http://schemas.microsoft.com/mapi/proptag/0x10F4000B) to true using MAPIFolder.PropertyAccessor.SetProperty.

  2. Create a folder outside of the IPM subtree visible to the end user. All stores start with the root folder not visible to the user. IPM root folder is a child of that root folder. You can create a folder as a sibling of the IPM root folder, but you'd need to use Extended MAPI (C++ or Delphi) or Redemption (I am its author - any language) for that. Something like the following:

set Session = CreateObject("Redemption.RDOSession") Session.MAPIOBJECT = ol.Session.MAPIOBJECT set Store = Session.Stores.DefaultStore set HiddenFolder = Store.RootFolder.Folders.Add("Not visible")

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78