Listing 2: The PurgeFolder() Function NONEXECUTABLE Private Function PurgeFolder(objFolder As MAPIFolder) As String Dim colItems As Items Dim objItem As Object Dim strRes As String Dim intCount As Integer Set colItems = objFolder.Items Set objItem = colItems.GetFirst Do Until objItem Is Nothing objItem.Delete intCount = intCount + 1 Set objItem = colItems.GetNext Loop If intCount > 0 Then strRes = Format(intCount) & " items purged" Else strRes = "no items purged" End If PurgeFolder = strRes Set objItem = Nothing Set colItems = Nothing End Function