Click here to Skip to main content
15,886,844 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am developing an Addin for Outlook 2007 in c#. I have a signature of my own which should be inserted pro grammatically in the HTML Body. When I click on the new compose i am able to add my signature to the HTML body. The same thing when i click on the Reply button the signature is not added to the HTML Body. Only the reply mail item is shown without the signature. This is the same for Forward and Reply All also. My Question is why my signature is not concatenated with the Reply and forward items?. Is there anything that i need to do for Reply, Forward and Reply All.

Below is my code.
C#
void Inspectors_NewInspector(Microsoft.Office.Interop.Outlook.Inspector Inspector)
{
            Outlook.MailItem mailItem = (Outlook.MailItem)Inspector.CurrentItem;

            string outlookAccountID = string.Empty;
            Microsoft.Office.Interop.Outlook.Recipient recipient = this.Application.GetNamespace("MAPI").CurrentUser;
            outlookAccountID = recipient.Address;

            mySignature = string.Format("<br /><br /><br /><br />" + mySignature + "", "");

            if (mailItem != null)
            {
                if (mailItem.EntryID == null)
                {
                    string htmlSource = mySignature + mailItem.HTMLBody;
                    mailItem.HTMLBody = htmlSource;
                }
            }
}
Posted
Updated 21-Aug-13 19:29pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900