Hi,
I'm doing a feature in outlook addin, when I open a email item, I am able to create a task item based on the email item, my code now is able to copy all the data in the mail item and put it into the task item, the only problem I encounter is that I am not able to copy the attachments in the email item into the task item. How am I able to do that
Below is the code I already wrote:
Outlook.
Application outlookApp = new Outlook.Application(); object item = outlookApp.ActiveExplorer().Selection[1];Outlook.
MailItem mail = (Outlook.MailItem)item; //CreateTaskOutlook.
MAPIFolder tasksFolder = outlookApp.GetNamespace("MAPI").GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderTasks);Outlook.
TaskItem taskItem = (Outlook.TaskItem)tasksFolder.Items.Add(Outlook.OlItemType.olTaskItem);taskItem.Subject = mail.Subject;
taskItem.Body = mail.Body;
taskItem.Save();
Thanks.