locked
outlook TaskItem sendstatus RRS feed

  • Question

  • Hello 

    I am using outlool Task Item class and when I use statusReopt methode, it doen't send any report or mail, please see below code

      var outlookObj = new Microsoft.Office.Interop.Outlook.Application();
                        fldTasks = (MAPIFolder)outlookObj.Session.GetDefaultFolder(OlDefaultFolders.olFolderTasks);

      foreach (_TaskItem item in fldTasks.Items)
                        {
                         
                                item.StatusOnCompletionRecipients = "abc@gmail.com";
                                item.StatusUpdateRecipients = "abc@gmail.com"
       tem.StatusReport();
                               // item.Send();
                                break;
                         
                        }

    Please reply ASAP. I really need this one.

    Monday, November 18, 2013 6:34 AM

Answers

  • Hi Rajesh Sharma eplanet,

      Welcome to MSDN Forum Support.

      Supposed you have added the reference named Microsoft.Office.Interop.Outlook.dll and create a new Windows Form Windows. The next step is assign Microsoft.Office.Interop.Outlook to namespace named Outlook.

     
     Outlook.Application olApp = new Outlook.Application();
      Outlook.MailItem mailItem = (Outlook.MailItem)olApp.CreateItem(Outlook.OlItemType.olMailItem);
     mailItem.To = "xyz@hotmail.com";
     mailItem.Subject = "A test";
     mailItem.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
     mailItem.HTMLBody = "Hello world";
     ((Outlook._MailItem)mailItem).Send();
     mailItem = null;
     olApp = null;
     MessageBox.Show("Mail has been sent successfully!");
    

       But the prerequisite of this way it to open the Outlook application firstly.

      Sincerely,

      Jason Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Jason Dot Wang Monday, November 25, 2013 9:36 AM
    Tuesday, November 19, 2013 1:47 AM

All replies

  • Hi Rajesh Sharma eplanet,

      Welcome to MSDN Forum Support.

      Supposed you have added the reference named Microsoft.Office.Interop.Outlook.dll and create a new Windows Form Windows. The next step is assign Microsoft.Office.Interop.Outlook to namespace named Outlook.

     
     Outlook.Application olApp = new Outlook.Application();
      Outlook.MailItem mailItem = (Outlook.MailItem)olApp.CreateItem(Outlook.OlItemType.olMailItem);
     mailItem.To = "xyz@hotmail.com";
     mailItem.Subject = "A test";
     mailItem.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
     mailItem.HTMLBody = "Hello world";
     ((Outlook._MailItem)mailItem).Send();
     mailItem = null;
     olApp = null;
     MessageBox.Show("Mail has been sent successfully!");
    

       But the prerequisite of this way it to open the Outlook application firstly.

      Sincerely,

      Jason Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Jason Dot Wang Monday, November 25, 2013 9:36 AM
    Tuesday, November 19, 2013 1:47 AM
  • Thank you your reply,

    But I am able to see code, it is not sending status report, I have to send status of task as well.

    Thursday, December 5, 2013 12:10 PM