outlook sent mails
<p>Hi i want to get outlook sent attachments and recipient subject of the mail sent... i am able to get it by Default Folders of outlook.
How can i retrieve the sent mails by VSTO before the mails is being sent.</p>

<p>now i am doing so</p>

<pre><code>namespace OutlookAddInAttachment
{
    public partial class ThisAddIn
    {
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            this.Application.NewMail += new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_NewMailEventHandler(ThisApplication_NewMail);

    }

    private void ThisApplication_NewMail()
    {
        Outlook.MAPIFolder SentMail = this.Application.ActiveExplorer().Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderOutbox);
        Outlook.Items SentMailItems = SentMail.Items;
        Outlook.MailItem newEmail = null;
        //SentMailItems = SentMailItems.Restrict("[Unread] = true");
        try
        {
            foreach (object collectionItem in SentMailItems)
            {
                newEmail = collectionItem as Outlook.MailItem;
                if (newEmail != null)
                {
                    if (newEmail.Attachments.Count &gt; 0)
                    {
                        for (int i = 1; i &lt;= newEmail.Attachments.Count; i++)
                        {
                            newEmail.Attachments[i].SaveAsFile(@"C:\TestFileSave\" + newEmail.Attachments[i].FileName);
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
            string errorInfo = (string)ex.Message
                .Substring(0, 11);
            if (errorInfo == "Cannot save")
            {
                MessageBox.Show(@"Create Folder C:\TestFileSave");
            }
        }
    }
</code></pre>
