![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I am using shared addins in VB.net 2005 for developin Outlook addin. How can
I write my code for changing mailitem body and attachment on the event fired just before opening a mailitem . |
Ads |
#2
|
|||
|
|||
![]()
The NewInspector event of the Inspectors collection fires when a new item is
opened. However, you cannot rely on the item in the Inspector being fully populated in that event. If you only want to handle mail items you will need to check the Inspector.CurrentItem.Class property (using reflection) in that event and then use the first Inspector.Activate event for that Inspector to get at the mail item properties such as Body or the Attachments collection. -- 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 "ASAR" wrote in message ... I am using shared addins in VB.net 2005 for developin Outlook addin. How can I write my code for changing mailitem body and attachment on the event fired just before opening a mailitem . |
#3
|
|||
|
|||
![]()
What if the mailitem is not new i.e it is read and presentin outlook
explorer window. "Ken Slovak - [MVP - Outlook]" wrote: The NewInspector event of the Inspectors collection fires when a new item is opened. However, you cannot rely on the item in the Inspector being fully populated in that event. If you only want to handle mail items you will need to check the Inspector.CurrentItem.Class property (using reflection) in that event and then use the first Inspector.Activate event for that Inspector to get at the mail item properties such as Body or the Attachments collection. -- 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 "ASAR" wrote in message ... I am using shared addins in VB.net 2005 for developin Outlook addin. How can I write my code for changing mailitem body and attachment on the event fired just before opening a mailitem . |
#4
|
|||
|
|||
![]()
It doesn't matter if the item is new, a reply, a forward or whatever. If you
open it you get a NewInspector event, since all open Outlook items are displayed in Inspectors. -- 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 "ASAR" wrote in message ... What if the mailitem is not new i.e it is read and presentin outlook explorer window. |
#5
|
|||
|
|||
![]()
I tried it it is working but when ichanged the properties of militem like
subject ,body , attachment on this event and save it It doesnot appear while mail item is opened. I am using following code Private Sub tyINS_NewInspector(ByVal Inspector As Microsoft.Office.Interop.Outlook.Inspector) Handles tyINS.NewInspector Dim test As Object test = Inspector.CurrentItem test.Subject = "NEW SUBJECT" test.Body = "NEW BODY APPENDED TO MAIL ITEM" test.Save() End Sub "Ken Slovak - [MVP - Outlook]" wrote: It doesn't matter if the item is new, a reply, a forward or whatever. If you open it you get a NewInspector event, since all open Outlook items are displayed in Inspectors. -- 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 "ASAR" wrote in message ... What if the mailitem is not new i.e it is read and presentin outlook explorer window. |
#6
|
|||
|
|||
![]()
I told you already to use the first Activate() event for that Inspector to
do what you want. -- 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 "ASAR" wrote in message ... I tried it it is working but when ichanged the properties of militem like subject ,body , attachment on this event and save it It doesnot appear while mail item is opened. I am using following code Private Sub tyINS_NewInspector(ByVal Inspector As Microsoft.Office.Interop.Outlook.Inspector) Handles tyINS.NewInspector Dim test As Object test = Inspector.CurrentItem test.Subject = "NEW SUBJECT" test.Body = "NEW BODY APPENDED TO MAIL ITEM" test.Save() End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Event handler when a mail from the inbox is selected | Cherry | Add-ins for Outlook | 1 | February 9th 08 01:10 PM |
event fired when email address clicked | Peter | Add-ins for Outlook | 1 | June 1st 07 07:05 PM |
Search of an event fired immediate before Quit-event | Peter Ostermann | Outlook and VBA | 4 | April 6th 07 07:46 AM |
Explorer' Close event not fired | j | Add-ins for Outlook | 9 | April 2nd 07 02:24 PM |
What event gets fired when i show/hide my outlook toolbar | Gautam | Outlook and VBA | 1 | July 12th 06 02:21 PM |