A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

how to get the Appointment End property



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 10th 08, 02:28 AM posted to microsoft.public.outlook.program_vba
soworl
external usenet poster
 
Posts: 34
Default how to get the Appointment End property

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  
Old April 10th 08, 04:08 PM 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

#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  
Old April 10th 08, 07:04 PM posted to microsoft.public.outlook.program_vba
soworl
external usenet poster
 
Posts: 34
Default how to get the Appointment End property

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  
Old April 10th 08, 10:20 PM posted to microsoft.public.outlook.program_vba
soworl
external usenet poster
 
Posts: 34
Default how to get the Appointment End property

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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 09:22 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.