title: Outlook vsto - Folder restrictions
body: <p>I have a little Outlook 2010 AddIn and need to restrict some actions on a custom folder: </p>
  
  <ul>
  <li>Can I somehow prevent the user from renaming a folder?</li>
  <li>Is it possible to prevent the user from moving any item to the folder? I know the ItemAdd Event, but this is only fired after the item was already moved. This is too late for me.</li>
  <li>Would it be possible to disable the context menu (right click) of a folder?</li>
  </ul>
  
  <p>Thanks a lot!</p>
  
  <p>// edit: I think I found a solution for the context menu problem. Is that ok or is there a flaw in doing this?</p>
  
  <pre class="lang-cs prettyprint-override"><code>outlook.FolderContextMenuDisplay += DisableArchiveFolderContextMenu;
  private void DisableArchiveFolderContextMenu(Office.CommandBar commandBar, MAPIFolder folder)
  {
    if (folder.Name.Equals(Settings.Default.ArchiveFolderName))
    {
      // Disable the context menu
      commandBar.Enabled = false;
    }
    else
    {
      commandBar.Enabled = true;
    } 
  }
  </code></pre>