function DeleteFile(const FileName: string): Boolean;
Deletes a subfolder from the given folder.HRESULT DeleteFolder(ULONG cbEntryID, LPENTRYID lpEntryID, ULONG ulUIParam, LPMAPIPROGRESS lpProgress, ULONG ulFlags)ParameterscbEntryIDInput parameter containing the number of bytes in the entry identifier pointed to by the lpEntryID parameter. lpEntryIDInput parameter pointing to the entry identifier of the folder to delete.ulUIParamInput parameter containing the handle of the window the dialog box is modal to. The ulUIParam parameter is ignored unless the FOLDER_DIALOG flag is set in the ulFlags parameter and NULL is passed in the lpProgress parameter.lpProgressInput parameter pointing to a progress object that contains client-supplied progress information. If NULL is passed in the lpProgress parameter, the progress information is provided by MAPI. The lpProgress parameter is ignored unless the FOLDER_DIALOG flag is set in the ulFlags parameter.ulFlagsInput parameter containing a bitmask of flags used to control the deletion of the folders. The following flags can be set:DEL_FOLDERSDeletes all subfolders of the subfolder indicated in the lpEntryID parameter. DEL_MESSAGESDeletes all messages in the folder indicated in the lpEntryID parameter.FOLDER_DIALOGDisplays a progress-information user interface while the operation proceeds.Return ValuesS_OKThe call succeeded and has returned the expected value or values.MAPI_E_HAS_FOLDERSThe folder being deleted contains folders and the DEL_FOLDERS flag was not set. The folder was not deleted.MAPI_E_HAS_MESSAGESThe folder being deleted contains messages and the DEL_MESSAGES flag was not set. The folder containing the messages was not deleted.MAPI_W_PARTIAL_COMPLETIONThe call succeeded, but not all of the entries were successfully deleted. Use the HR_FAILED macro to test for this warning, though the call should be handled as a successful return.