After Running Macro, Outlook hangs on exit. 
Author Message
 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
  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


Sun, 15 May 2005 01:10:19 GMT  
 [ 1 post ] 

 Relevant Pages 

1. vb2003 outlook addin hangs on exit

2. Macro to exit outlook

3. Run Macro on Exit of FormField

4. IPF on exit after VBA macro runs (Word2K SR-1 on Win2K Pro)

5. Run macro upon exit from table cell

6. "Run On Exit" macro

7. Getting macro to run on exit from FormField

8. Running Outlook 2000 VB macros with high security.

9. URGENT! Running a macro in outlook 2000

10. Help - Outlook 2000 crashes *sometimes* when running my VBA macro

11. Running Macro From Outlook ??

12. scheduleing macro to run in outlook


Powered by phpBB® Forum Software