title: How to remove Deleted items folder from Outlook PST file
body: <p><a href="https://i.stack.imgur.com/5VimZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5VimZ.png" alt="enter image description here"></a></p>
  
  <p>Hi,
  I have created one PST file using C# code. My Sample code is here.</p>
  
  <pre><code>string pstlocation = @"C:\Users\{USER}\Desktop\PST Files\Test.pst";
  Outlook._Application OutlookObject = this.Application;
  Outlook.NameSpace outlookNs = null;
  Outlook.Folder objRootFolder = null;
  outlookNs = Application.GetNamespace("MAPI");    
  
  outlookNs.AddStore(pstlocation);
  objRootFolder = outlookNs.Folders.GetLast() as Folder;    
  </code></pre>
  
  <p>My PST file is Added successfully in outlook 2013. When i am try to delete <strong>Deleted Items</strong> but it is not deleted and it give us an error.</p>
  
  <pre><code>foreach (Folder objFolder in objRootFolder.Folders)
      {
              objFolder.Delete();
             //It gives an error.
      }
  </code></pre>
  
  <p>Error : An exception of type 'System.Runtime.InteropServices.COMException' occurred in OutlookAddInPSTTest.dll but was not handled in user code</p>
  
  <p>Additional information: Cannot delete this folder. Right-click the folder, and then click Properties to check your permissions for the folder. See the folder owner or your administrator to change your permissions.</p>
  
  <p>===================================================================</p>
  
  <p>So, how can i delete <strong>Deleted Items</strong> from PST file.</p>