Delphi GetFolderCount, GetFolderProp sample |
Top Previous Next |
Delphi GetFolderCount, GetFolderProp sample:
uses MCore; var PSTFileName: string; THandle: dword; FolderCount: integer; Folder: TFolderProp; begin PSTFileName := ParamStr(1); //Get .PST file name from command line PSTHandle := OpenMailbox(PChar(PSTFileName)); //Open selected PST file by Mailbox Core if PSTHandle > OMS_NOERROR then //If Mailbox open OK begin GetMailInEMLFormat(True); //Set "EML Output Format" flag for FolderCount := 0 to GetFolderCount(PSTHandle) - 1 do //Enumerate all folders begin GetFolderProp(PSTHandle, FolderCount, Folder); //Open folder WriteLn('Open folder: ' + Folder.Path); end; CloseMailbox(PSTHandle); //Close Opened mailbox end else WriteLn('Open mailbox problem: ' + TokenizeErrorCode(PSTHandle)); end.
© MCore Team 2005-2008, please contact as |