I tried to delete contact item with my Outlook VSTO Add-In but the deleted contact item is moved to drafts folder instead of trash folder.
public void Delete(Outlook.ContactItem oco)
{
if (oco != null)
{
privateInfo = oco.FullName;
Outlook.NameSpace mapiNamespace = _Application.GetNamespace("MAPI");
if (mapiNamespace != null)
{
Outlook.MAPIFolder trashFolder = mapiNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderDeletedItems);
if (trashFolder != null)
{
string folderpath = trashFolder.FolderPath // to debug only
oco.Move(trashFolder);
}
}
}
}
The folderpath variable shows the right folder. I develop with Outlook 2016. I use Microsoft.Office.Iterop V15.0.4420.1017.
Who can explain this behavior?
Thanks