/// <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); }
/// <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); }
public bool MoveMessage(MAPIMessage message, MAPIFolder folderDest) { return FolderMoveMessage(pObject, message.Pointer, folderDest.Pointer); }
/// <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); }
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(); } } }
public bool MoveMessage(MAPIMessage message, MAPIFolder folderDest) { return(FolderMoveMessage(pObject, message.Pointer, folderDest.Pointer)); }
/// <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)); }