
After Running Macro, Outlook hangs on exit.
I have written a simple macro that recurses through the contents of a folder
and marks everything inside it (and all its subfolders) as read. It runs
fine, without giving me any errors. When I go to exit outlook, the "Please
wait while Outlook exits" box shows up and never goes away. I have to kill
outlook using the task manager.
Outook version is 2000 SR-1 with Corporate/Workgroup setup.
Here is the code:
Public Sub MarkReceiptsAsRead()
MarkFoldersAsRead (Application.GetNamespace("MAPI").Folders("Personal
Folders").Folders("Receipts"))
End Sub
Private Sub MarkFoldersAsRead(TopFolder As MAPIFolder)
Dim I As Integer
If TopFolder.Items.Count > 0 Then
For I = 1 To TopFolder.Items.Count
TopFolder.Items(I).UnRead = False
Next I
End If
If TopFolder.Folders.Count > 0 Then
For I = 1 To TopFolder.Folders.Count
MarkFoldersAsRead (TopFolder.Folders(I))
Next I
End If
Set TopFolder = Nothing
End Sub
Any help would be appreciated:
Matt Harris
(818) 553-4788
http://www.*-*-*.com/