/// <summary> /// Delete all attachments using attachmentfactory Object /// </summary> /// <param name="attachmentFactory">TDAPIOLELib.AttachmentFactory Object</param> /// <returns>True if successfull</returns> public static Boolean DeleteAllAttachments(TDAPIOLELib.AttachmentFactory attachmentFactory) { TDAPIOLELib.List AttachmentsList = attachmentFactory.NewList(""); foreach (TDAPIOLELib.Attachment OAttach in AttachmentsList) { attachmentFactory.RemoveItem(OAttach.ID); } return(true); }
/// <summary> /// Delete Attachments by name /// </summary> /// <param name="attachmentFactory">TDAPIOLELib.AttachmentFactory Object</param> /// <param name="attachmentName">name of the attachment to be deleted</param> /// <returns>Return true if successfull</returns> public static Boolean DeleteAttachmentByName(TDAPIOLELib.AttachmentFactory attachmentFactory, String attachmentName) { TDAPIOLELib.List AttachmentsList = attachmentFactory.NewList(""); foreach (TDAPIOLELib.Attachment OAttach in AttachmentsList) { if (OAttach.Name.EndsWith(attachmentName)) { attachmentFactory.RemoveItem(OAttach.ID); break; } } return(true); }