0

I want to make a Outlook Addin to make attachment file to ZIP file automatically. Now ,i have to get the TaskItem to make the task mail which i send to others is only have ZIP attachmens files.

I have trid the folowing code to get TaskItems.but always get the TaskItem which i sent myself.which i send to others task mail is not To zip file yet.

Wish Someone can help me.Thanks.

     //the addin start up
     private void ThisAddIn_Startup(object sender, System.EventArgs e)
    {
        Application.ItemSend += new Outlook.ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend);
    }

    //before send the mail
     public void Application_ItemSend(object Item, ref bool Cancel)
    {

        //get  the task items
        var myinspector = Application.ActiveInspector();
        if (myinspector != null)
        {
            //get the TaskItem    
            TaskItem OutlookTaskItem = myinspector.CurrentItem as TaskItem;

            /*

            automatically to make attachment file to ZIP file.

            */


        }

    }
SuperDeve
  • 11
  • 3

1 Answers1

0

If you want to get a reference to the item being sent, you have to use the Item parameter that is already passed to the Item_Send event. You are referencing an open item window with ActiveInspector, which may not be the same as the item being sent.

Eric Legault
  • 5,706
  • 2
  • 22
  • 38