internal void DeleteProxyAttachments(IProxy mailItem, Workshare.PolicyContent.Attachment[] processedAttachments) { // Create a collection of processed Attachment ids int size = processedAttachments.Length; List<string> processedAttachmentIds = new List<string>(size); for (int j = 0; j < size; ++j) { processedAttachmentIds.Add(processedAttachments[j].Id); } // Items in the Proxy Attacments collection that does not have a coresponding // item in the processed Attachment collection are marked for deletion. int count = mailItem.GetAttachmentsCount(); for (int i = 0; i < count; ++i) { NotesProxy.Attachment proxyAttachment = mailItem.GetAttachment(i); if (!processedAttachmentIds.Contains(proxyAttachment.GetContentId())) { proxyAttachment.SetProcessStatus(AttachmentProcessStatus.ProcessStatus_Delete); } } }