Example #1
0
 /// <summary>
 /// Creates a sub-folder or opens it if it already exists
 /// </summary>
 /// <param name="strSubFolder">name of the folder</param>
 /// <param name="folder">MAPIFolder object</param>
 /// <returns>true on success</returns>
 public bool CreateSubFolder(string strSubFolder,out MAPIFolder folder)
 {
     folder = null;
     IntPtr pSubFolder = FolderCreateSubFolder(pObject, strSubFolder);
     if (pSubFolder != IntPtr.Zero)
     {
         folder = new MAPIFolder(pSubFolder);
     }
     return (folder != null);
 }
Example #2
0
 /// <summary>
 /// Retrieves the next sub-folder in the currently opened hierarchy
 /// </summary>
 /// <param name="folder">MAPIFolder object</param>
 /// <param name="strFolderName">name of the folder</param>
 /// <returns>true on success</returns>
 public bool GetNextSubFolder(out MAPIFolder folder, StringBuilder strFolderName)
 {
     IntPtr pFolder;
     folder = null;
     if (MAPIGetNextSubFolder(pMAPI, out pFolder, strFolderName, strFolderName.Capacity))
     {
         folder = new MAPIFolder(pFolder);
     }
     return (folder != null);
 }
Example #3
0
 public bool MoveMessage(MAPIMessage message, MAPIFolder folderDest)
 {
     return FolderMoveMessage(pObject, message.Pointer, folderDest.Pointer);
 }
Example #4
0
 /// <summary>
 /// Deletes a sub-folder and ALL sub-folders/messages
 /// </summary>
 /// <param name="folder">folder object to delete</param>
 /// <returns>true on success</returns>
 public bool DeleteSubFolder(MAPIFolder folder)
 {
     return FolderDeleteSubFolder(pObject, folder.pObject);
 }
Example #5
0
 private static void EnumerateSubFolders(MAPIFolder folder)
 {
     if (folder.GetHierarchy())
     {
         StringBuilder s = new StringBuilder(NetMAPI.DefaultBufferSize);
         MAPIFolder subFolder;
         while (folder.GetNextSubFolder(out subFolder, s))
         {
             Console.WriteLine("SubFolder: " + s.ToString());
             EnumerateSubFolders(subFolder);
             subFolder.Dispose();
         }
     }
 } 
Example #6
0
 public bool MoveMessage(MAPIMessage message, MAPIFolder folderDest)
 {
     return(FolderMoveMessage(pObject, message.Pointer, folderDest.Pointer));
 }
Example #7
0
 /// <summary>
 /// Deletes a sub-folder and ALL sub-folders/messages
 /// </summary>
 /// <param name="folder">folder object to delete</param>
 /// <returns>true on success</returns>
 public bool DeleteSubFolder(MAPIFolder folder)
 {
     return(FolderDeleteSubFolder(pObject, folder.pObject));
 }