Results 1 to 1 of 1

Thread: Cleaning Outllook "Sync Issues" folder

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2015
    Posts
    596

    Cleaning Outllook "Sync Issues" folder

    In Outlook you can find the "Sync Issues" folder that s filled QUITE A LOT (at least on my computers here).
    Name:  rtaImage.png
Views: 176
Size:  19.5 KB

    This is due to some conflict whenusing IMAP and several computers/clients etc...

    This folder contained several thousand of message (in fact, those logs are created on regular basis).
    Of course, you can delete them manually.

    I searched the web for an addin or code doing a clean, but nothing found.
    So, I wrote a small code in VB.NET that I added to my Outlook Addin that cleans automatically at startup of Outlook.

    Code Code:
    1. Public Sub Outlook_Clean_SyncIssues(oOutlook As Outlook.Application)
    2.  
    3.         Dim oNameSpace As Outlook.NameSpace
    4.         Dim oStore As Outlook.Store
    5.  
    6.         Dim oFolder As Outlook.Folder
    7.         Dim aFolderConflicts() As Long = {20, 19, 22} ' olFolderSyncIssues, olFolderConflicts, olFolderServerFailures
    8.         Dim nFolder As Long
    9.  
    10.         Dim nMessages As Long
    11.         Dim nMessage As Long
    12.  
    13.         Try
    14.             oNameSpace = oOutlook.GetNamespace("MAPI")
    15.  
    16.             For Each oStore In oNameSpace.Stores
    17.                 For Each nFolder In aFolderConflicts
    18.                     oFolder = Nothing
    19.                     Try
    20.                         oFolder = oStore.GetDefaultFolder(nFolder)
    21.                     Catch ex As Exception
    22.                     End Try
    23.  
    24.                     If Not (oFolder Is Nothing) Then
    25.                         nMessages = oFolder.Items.Count
    26.                         Debug(oStore.DisplayName & " (" & nMessages & ")")
    27.                         If nMessages <> 0 Then
    28.                             For nMessage = nMessages To 1 Step -1
    29.                                 'oFolder.Items.Item(nMessage).Delete
    30.                                 Debug(oFolder.Items.Item(nMessage).Subject)
    31.                             Next
    32.                         End If
    33.                     End If
    34.                 Next
    35.             Next
    36.         Catch ex As Exception
    37.             Debug(ex.Message)
    38.         End Try
    39.  
    40.     End Sub
    41.  
    42.     Private Sub Trace(sFormat As String, ParamArray args As Object())
    43.  
    44.         Diagnostics.Debug.Print(sFormat, args)
    45.  
    46.     End Sub
    47.  
    48.     Public Sub Debug(Optional sData As String = vbNullString)
    49.  
    50.         Dim StackTrace As New System.Diagnostics.StackTrace()
    51.         Dim Frame As Diagnostics.StackFrame = StackTrace.GetFrame(1)
    52.         Trace(FormatDateTime(Now, DateFormat.ShortTime) & " OutlookAssist - {0}({1})", Frame.GetMethod().Name, sData)
    53.  
    54.     End Sub

    NB : By default, it just display in debug the informations.
    To delete the lofs, just uncomment the line " 'oFolder.Items.Item(nMessage).Delete"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width