View Single Post
  #2  
Old April 23rd 09, 02:42 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Outlook2007 and VSTO, handle the Click on the Save Button in the IPM.Note dialog HOWTO?

You will need to get a handle to the opened item in the NewInspector() event
of the Inspectors collection, then set up to handle the Write() event of the
opened item.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Michael Schmitz" wrote in message
...
Hello NG,

i made a simple FromRegion Addin where I have a button and a textbox.

When i click on the button in the region i am saving the value in the
mail.
So far so good.

Now i want to remove this button from the form Region,
and instead the code in the eventhadler should be executed when
the user clicks on the save Button in the upper right corner of the
Dialog next to the Office Button.

I hope i made it clear what i want

Regards

Michael

Codesnippets:
################################

this._btnSave.Click += new System.EventHandler(this.On_btnSave_Click);



EventHandler ButnSave Click:

private void On_btnSave_Click(object sender, EventArgs e)
{
Outlook.MailItem mail;
Outlook.ItemProperties properties;

try
{

if (this.OutlookItem is Outlook.MailItem)
{
mail = (Outlook.MailItem)this.OutlookItem;
properties = mail.ItemProperties;

// aender den Betreff wie gewuenscht ab
mail.Subject = this._txt1.Text;


mail.Save();
}
}
finally
{
mail = null;
properties = null;
}
}


Ads