Automatically delete messages in the synchronization folder

Status
Not open for further replies.

gruiz

Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
Ocassionally my "Sync issues" and "Conflicts" folders gets cluttered with messages (some of them with attachments) and my available free space decreases to the point that "mailbox full" message level gets triggered.

Since this folder is not visible in the default Outlook 2016 view I have to change that to Folders, go to the "sync issues" folder and delete all the messages in that folder and in several subfolders (Conflicts).

Is there any way to empty this folder (and subfolders) using VBA at startup, how do I refer to this special folder?

I know this folders and messages are created for reporting issues but at this moment there are the main source for problems since my mailbox gets full almost every single day. Those messages takes up several MBs.

Thanks!
 
Ocassionally my "Sync issues" and "Conflicts" folders gets cluttered with messages (some of them with attachments) and my available free space decreases to the point that "mailbox full" message level gets triggered.

Since this folder is not visible in the default Outlook 2016 view I have to change that to Folders, go to the "sync issues" folder and delete all the messages in that folder and in several subfolders (Conflicts).

Is there any way to empty this folder (and subfolders) using VBA at startup, how do I refer to this special folder?

I know this folders and messages are created for reporting issues but at this moment there are the main source for problems since my mailbox gets full almost every single day. Those messages takes up several MBs.

Thanks!
That folder shouldn't sync to the server. But yes, you can use VBA to empty it.

Or use auto archive to delete them.

This VBA is written for deleted items but would work for sync issues too - just change the folder name.


Autoarchive steps are here -
 
Yes, it's possible to use VBA code to delete messages from the "Sync Issues" and "Conflicts" folders in Outlook at startup. You can refer to the "Sync Issues" folder by its EntryID, which is a unique identifier for each folder in Outlook.

Here's an example VBA code that you can use:
Code:
Sub DeleteSyncIssues()
    Dim olApp As Outlook.Application
    Dim olNS As Outlook.Namespace
    Dim olSyncFolder As Outlook.Folder
    Dim olConflictsFolder As Outlook.Folder
    Dim olSyncItem As Outlook.MailItem
    
    ' Get the Outlook application object and namespace
    Set olApp = Outlook.Application
    Set olNS = olApp.GetNamespace("MAPI")
    
    ' Get the Sync Issues and Conflicts folders
    Set olSyncFolder = olNS.GetFolderFromID("0000001A-0000-0000-C000-000000000046\Sync Issues")
    Set olConflictsFolder = olSyncFolder.Folders("Conflicts")
    
    ' Loop through the Sync Issues folder and delete all items
    For Each olSyncItem In olSyncFolder.Items
        olSyncItem.Delete
    Next olSyncItem
    
    ' Loop through the Conflicts folder and delete all items
    For Each olSyncItem In olConflictsFolder.Items
        olSyncItem.Delete
    Next olSyncItem
    
    ' Clean up objects
    Set olSyncItem = Nothing
    Set olConflictsFolder = Nothing
    Set olSyncFolder = Nothing
    Set olNS = Nothing
    Set olApp = Nothing
End Sub
You can add this code to your Outlook VBA project by following these steps:

  1. In Outlook, press Alt + F11 to open the VBA editor
  2. In the Project Explorer, right-click on your Outlook project and select "Insert > Module"
  3. Paste the code above into the new module
  4. Save the module and close the VBA editor
To automatically run this code at startup, you can add a Application_Startup event handler to your ThisOutlookSession module:

  1. In the VBA editor, open the ThisOutlookSession module
  2. Paste the following code into the module:
Code:
Private Sub Application_Startup()
    DeleteSyncIssues
End Sub
  1. Save the module
Now, every time you start Outlook, the DeleteSyncIssues subroutine will automatically run and delete all items from the "Sync Issues" and "Conflicts" folders. This should help you free up space in your mailbox and prevent the "mailbox full" message from appearing.
 
Ocassionally my "Sync issues" and "Conflicts" folders gets cluttered with messages (some of them with attachments) and my available free space decreases to the point that "mailbox full" message level gets triggered.

Since this folder is not visible in the default Outlook 2016 view I have to change that to Folders, go to the "sync issues" folder and delete all the messages in that folder and in several subfolders (Conflicts).

Is there any way to empty this folder (and subfolders) using VBA at startup, how do I refer to this special folder?

I know this folders and messages are created for reporting issues but at this moment there are the main source for problems since my mailbox gets full almost every single day. Those messages takes up several MBs.

Thanks!


I understand this but have you ever thought of using sources that would help you with your studies, like http://essaypapers.reviews/ because I have been using this for a long time now and I feel absolutely fine because I don't have to spend a lot of time writing.
Yes, shure
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
T How to remove "automatically delete messages form this sender"? Using Outlook 1
F Automatically delete previous messages in a conversation Using Outlook 2
G Automatically delete email when a condition is met Outlook VBA and Custom Forms 1
undercover_smother Automatically Forward All Sent Mail and Delete After Send Outlook VBA and Custom Forms 10
A Code to automatically delete message after sending Outlook VBA and Custom Forms 6
S Delete an email automatically from a name in the TO box Using Outlook 3
M Outlook 365 macro - automatically attach file based on subject line Outlook VBA and Custom Forms 0
kburrows Outlook Automatically Merging Contacts Using Outlook 2
A Opening a link from an email automatically Outlook VBA and Custom Forms 0
A Opening a link from a specific sender automatically Outlook VBA and Custom Forms 4
X Run macro automatically when a mail appears in the sent folder Using Outlook 5
J Calendar events created on iPhone automatically changing default alert from 'None' to 'Time of Event' Using Outlook.com accounts in Outlook 0
Z Automatically adjust Outlook Reading Pane from bottom to right depending on portrait or landscape window Using Outlook 1
Hornblower409 Automatically or Manually Backup Multiple Versions of VbaProject.OTM Outlook VBA and Custom Forms 1
B Outlook 2019 Automatically move email after assigning category Using Outlook 4
G automatically choosing "add to autocorrect" option Using Outlook 0
L Why are some email automatically going to "archive" Using Outlook 2
Z Outlook 365 Automatically assign categories to incoming mail in a shared folder Round Robin Outlook VBA and Custom Forms 1
C Automatically Insert Recipient Name from To Field Outlook VBA and Custom Forms 4
E Remove flag automatically Using Outlook 4
T Outlook 365 Move newly created tasks automatically on save. Outlook VBA and Custom Forms 1
M Outlook 365 Switching from AOL to Yahoo automatically Using Outlook 5
P Print attachments automatically and move the mail to an existing folder called "Ted" Outlook VBA and Custom Forms 4
B Zoom automatically next email item (VBA) Outlook VBA and Custom Forms 2
Paul Hobbs Automatically accept "Empty Folders" prompt Outlook VBA and Custom Forms 6
diver864 vba for a rule to automatically accept meeting requests with 'vacation' in subject, change to all-day event, change to free, don't send reply Outlook VBA and Custom Forms 1
D Custom Search Folders not refreshing/updating automatically Using Outlook 0
M Automatically add senders first name to a greeting Outlook VBA and Custom Forms 1
C Add Form to Appointments Received, Automatically Outlook VBA and Custom Forms 6
J Automatically forward email and apply template Outlook VBA and Custom Forms 0
Y Outlook 2013 Stop Outlook from automatically assigning categories to Tasks Using Outlook 0
O Forward a email with modified body Automatically. Outlook VBA and Custom Forms 0
A How to open a specific link automatically with outlook 2016 Outlook VBA and Custom Forms 6
P Automatically Categorize Meetings once they are accepted Outlook VBA and Custom Forms 5
W Automatically open attachments without automatically printing them Using Outlook 0
N How to set automatically the default or user defined Quickstyle Templates by Answer in Outlook Using Outlook 1
O Run macro automatically at sending an email Using Outlook 11
D Outlook 2016 automatically increment anniversaries Using Outlook 1
T Office 2013 no longer updating automatically Using Outlook 2
B Automatically Forward Emails and Remove/Replace All or Part of Body Outlook VBA and Custom Forms 8
D Print attachments automatically and moves the mail to a new folder Outlook VBA and Custom Forms 9
A How to open a specific link automatically with outlook Outlook VBA and Custom Forms 13
L Automatically Insert Recipient Name from To Field Outlook VBA and Custom Forms 33
N how to sync automatically when outlook opens Using Outlook 10
A Sort emails into subfolders based on sender and deleting emails automatically Outlook VBA and Custom Forms 3
C Need VBA code to automatically save message outside outlook and add date Outlook VBA and Custom Forms 1
stephen li VBA Outlook send mail automatically by specified outlook mail box Outlook VBA and Custom Forms 1
R Make Enter Network Password Prompt Go Away Automatically Using Outlook 0
I Print Automatically Attachments Outlook VBA and Custom Forms 3
S Automatically selecting folders and deleting messages in Outlook VBA Outlook VBA and Custom Forms 7

Similar threads

Back
Top