A few weeks ago someone asked about removing empty folders from their mail. They were archiving stuff and the archive didn't remove the empty folders, so their mail file had a bunch of empty folders lying around. Here is code that can be placed in a button. The button goes through all the folders in the current database (which is assumed to be their mail file because the button was sent to them). If an empty folder is found, they are prompted whether it should be deleted or not. If the user says "Yes", then the folder is marked for deletion (not immediately deleted). After all the folders are investigated, the ones that were marked for deletion are deleted from the database. All throughout the process messages are printed to the status bar.

Sub Click(Source As Button)Dim session As New NotesSessionDim db As NotesDatabaseDim viewNames() As StringDim count As IntegerDim firstDoc As NotesDocumentDim results As StringDim answer As IntegerDim designDoc As NotesDocumentDim view As NotesViewDim user As StringDim foundAny As Integer