Hecht Juergen
Posts: 5
Joined: 2020-11-19
|
Hi all,
i have some problems with deleting files after sending mails. Currently i use the following Code to delete the attachments. Sometimes it works, but I can't really understand in which cases it works!
In my ThisAddn.vb i use
Private WithEvents mySentItems As Outlook.Items
in ThisAddIn_Startup()
mySentItems = Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderSentMail).Items
and this is my sub to delete the files.
Private Sub mySentItems_ItemAdd(mail As Outlook.MailItem) Handles mySentItems.ItemAdd
For i As Integer = mail.Attachments.Count To 1 Step -1
mail.Attachments.Remove(i)
Next
mail.Save()
Marshal.ReleaseComObject(mail)
End Sub
It seems that there is a problem with syncing to the Microsoft O365 Exchange Server.
Is there anybody which can help me with this problem.
Regards
Juergen |
|
Andrei Smolin
Add-in Express team
Posts: 18721
Joined: 2006-05-11
|
|