![]() |
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
|
|||
|
|||
![]()
Hello,
I don't know how I can get the "End" property of Appointment. Please, advise me. Thanks, soworl ================================================= #region event handlers private void Reminders_ReminderFire(Outlook.Reminder ReminderObject) { object objItem; objItem = ReminderObject.Item; string EndTime= objItem.GetType().InvokeMember("End", System.Reflection.BindingFlags.GetProperty, null, objItem, null) as string; ReminderObject.Dismiss(); objItem = null; } #endregion ================================================= |
Ads |
#2
|
|||
|
|||
![]()
#region event handlers
private void Reminders_ReminderFire(Outlook.Reminder ReminderObject) { object objItem; objItem = ReminderObject.Item; object[] args = new object[] { }; Type t = objItem.GetType(); string EndTime = (string)t.InvokeMember("End", BindingFlags.Public | BindingFlags.GetField | BindingFlags.GetProperty, null, objItem, args); ReminderObject.Dismiss(); objItem = null; } #endregion I'd stick all that in a try{}...catch{} block though. -- 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 "soworl" wrote in message ... Hello, I don't know how I can get the "End" property of Appointment. Please, advise me. Thanks, soworl ================================================= #region event handlers private void Reminders_ReminderFire(Outlook.Reminder ReminderObject) { object objItem; objItem = ReminderObject.Item; string EndTime= objItem.GetType().InvokeMember("End", System.Reflection.BindingFlags.GetProperty, null, objItem, null) as string; ReminderObject.Dismiss(); objItem = null; } #endregion ================================================= |
#3
|
|||
|
|||
![]()
Hi,
Thanks for quick reply. I had same problem before. If I use below code, Dismiss() dose not work. without below code, Dismiss() works fine T.T Is there any other way to get End time? string EndTime = (string)t.InvokeMember("End", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.GetField | System.Reflection.BindingFlags.GetProperty, null, objItem, args); "Ken Slovak - [MVP - Outlook]" wrote: #region event handlers private void Reminders_ReminderFire(Outlook.Reminder ReminderObject) { object objItem; objItem = ReminderObject.Item; object[] args = new object[] { }; Type t = objItem.GetType(); string EndTime = (string)t.InvokeMember("End", BindingFlags.Public | BindingFlags.GetField | BindingFlags.GetProperty, null, objItem, args); ReminderObject.Dismiss(); objItem = null; } #endregion I'd stick all that in a try{}...catch{} block though. -- 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 "soworl" wrote in message ... Hello, I don't know how I can get the "End" property of Appointment. Please, advise me. Thanks, soworl ================================================= #region event handlers private void Reminders_ReminderFire(Outlook.Reminder ReminderObject) { object objItem; objItem = ReminderObject.Item; string EndTime= objItem.GetType().InvokeMember("End", System.Reflection.BindingFlags.GetProperty, null, objItem, null) as string; ReminderObject.Dismiss(); objItem = null; } #endregion ================================================= |
#4
|
|||
|
|||
![]()
so strange,
it's ok with Subject property. If I use below code instead of End Property, Dismiss() works fine. string subject = (string)t.InvokeMember("Subject", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.GetField | System.Reflection.BindingFlags.GetProperty, null, objItem, args); "soworl" wrote: Hi, Thanks for quick reply. I had same problem before. If I use below code, Dismiss() dose not work. without below code, Dismiss() works fine T.T Is there any other way to get End time? string EndTime = (string)t.InvokeMember("End", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.GetField | System.Reflection.BindingFlags.GetProperty, null, objItem, args); "Ken Slovak - [MVP - Outlook]" wrote: #region event handlers private void Reminders_ReminderFire(Outlook.Reminder ReminderObject) { object objItem; objItem = ReminderObject.Item; object[] args = new object[] { }; Type t = objItem.GetType(); string EndTime = (string)t.InvokeMember("End", BindingFlags.Public | BindingFlags.GetField | BindingFlags.GetProperty, null, objItem, args); ReminderObject.Dismiss(); objItem = null; } #endregion I'd stick all that in a try{}...catch{} block though. -- 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 "soworl" wrote in message ... Hello, I don't know how I can get the "End" property of Appointment. Please, advise me. Thanks, soworl ================================================= #region event handlers private void Reminders_ReminderFire(Outlook.Reminder ReminderObject) { object objItem; objItem = ReminderObject.Item; string EndTime= objItem.GetType().InvokeMember("End", System.Reflection.BindingFlags.GetProperty, null, objItem, null) as string; ReminderObject.Dismiss(); objItem = null; } #endregion ================================================= |
#5
|
|||
|
|||
![]()
That probably means you're not getting an AppointmentItem and probably
should be wrapping the reflection call in a try...catch block like I said before. Why not just cast the item to an AppointmentItem if it is one and use early binding directly? You can test the Class property, which every Outlook item has: if (objItem = ReminderObject.Item.Class == Outlook.OlObjectClass.olAppointment) { // it's an appointment, continue } else { // if there's something you do for non-appointments } -- 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 "soworl" wrote in message ... so strange, it's ok with Subject property. If I use below code instead of End Property, Dismiss() works fine. string subject = (string)t.InvokeMember("Subject", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.GetField | System.Reflection.BindingFlags.GetProperty, null, objItem, args); |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Changing the "Category" property on an Outlook.Appointment Item | morna | Add-ins for Outlook | 0 | April 4th 08 07:21 PM |
PR_MESSAGE_DELIVERY_TIME property | Bill Le May | Outlook and VBA | 5 | February 20th 08 11:20 PM |
getting email address of To property in Outlook Inbox and From property in Outlook Outbox | Omatase | Outlook - General Queries | 1 | July 19th 07 02:04 PM |
delete property | Nikolas | Outlook - Using Forms | 13 | February 28th 07 08:53 PM |
Reading a Custom Appointment Item's Conflict Property in Item_Write Function | [email protected] | Outlook - Using Forms | 2 | August 9th 06 07:53 PM |