View Single Post
  #5  
Old April 11th 08, 12:15 AM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default how to get the Appointment End property

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);


Ads