dimanche 6 juin 2010 08:30
In Outlook 2007, when I execute the subroutine located on the online help page entitled "How to: Delete All Items and Subfolders in the Deleted Items Folder", the following error is returned:
Run-time error '-2147352567 (800200009)':
One or more items in the folder you synchronized do not match. To resolve the conflicts, open the items, and then try this operation again.
The error occurs when the oItems.Item(i).Delete statement is executed. Here is the code:
Dim oDeletedItems As Outlook.Folder
Dim oFolders As Outlook.Folders
Dim oItems As Outlook.Items
Dim i As Long
'Obtain a reference to deleted items folder
Set oDeletedItems = Application.Session.GetDefaultFolder(olFolderDeletedItems)
Set oItems = oDeletedItems.Items
For i = oItems.Count To 1 Step -1
Set oFolders = oDeletedItems.Folders
For i = oFolders.Count To 1 Step -1
Apparently, the item that is being deleted has a conflict (i.e., oItems.Item(i).IsConflict = "True"). But, I haven't been able to figure out how to resolve the conflict programmatically. Executing the Conflicts property returns an error (e.g., Debug.Print oItems.Item(i).Conflicts.Count).
Outlook 2007 is using a mailbox from Microsoft Exchange Server 8.1.393.1.
Any help would be much appreciated.
Toutes les réponses
mardi 8 juin 2010 09:57Modérateur
For this question, here is a thread you could refer to: http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/d1bc4ec6-58e6-4fb1-ba0d-5fb364954a2e. As far as I see, you also could try to use SyncObject to sync the message with Exchange Server: Application.Session.SyncObjects.Item(1).Start.
If this post does not help you, please feel free to follow up.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Marqué comme réponse Ji.ZhouModerator jeudi 17 juin 2010 01:36
jeudi 21 juin 2012 18:04
the item.isconflict thing just helped me immensely. thanks for the posts.