![]() |
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 want to aquire all items in the folder that starts later than a specified
time. How can I use the Restrict method to achieve this? In MSDN, there is a VB example: sFilter = "[LastModificationTime] '" & Format("1/15/99 3:30pm", "ddddd h:nn AMPM") & "'" But how about C#? I tried using String.Format with the following code but failed: Outlook.Items appointmentItems; try { string strStartTime = String.Format(startTime.ToString(), "ddddd h:nn AMPM"); appointmentItems = folder.Items.Restrict("[MessageClass] = 'IPM.Appointment'"); appointmentItems = folder.Items.Restrict("[Start] = '" + strStartTime + "'"); //Exception occurred here } catch(Exception ex) { ...... } |
Ads |
#2
|
|||
|
|||
![]()
I have figured it out myself. Just use:
DateTime.ToString("yyyy-MM-dd HH:mm"); "OctopusThu" wrote: I want to aquire all items in the folder that starts later than a specified time. How can I use the Restrict method to achieve this? In MSDN, there is a VB example: sFilter = "[LastModificationTime] '" & Format("1/15/99 3:30pm", "ddddd h:nn AMPM") & "'" But how about C#? I tried using String.Format with the following code but failed: Outlook.Items appointmentItems; try { string strStartTime = String.Format(startTime.ToString(), "ddddd h:nn AMPM"); appointmentItems = folder.Items.Restrict("[MessageClass] = 'IPM.Appointment'"); appointmentItems = folder.Items.Restrict("[Start] = '" + strStartTime + "'"); //Exception occurred here } catch(Exception ex) { ...... } |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to restrict task editing and deletion in Outlook 2003 ? | [email protected] | Add-ins for Outlook | 2 | October 11th 06 02:30 PM |
Outlook.MAPIFolder, VBA macros | lerneree | Outlook - Using Forms | 0 | September 6th 06 10:18 AM |
how to retain 10 days items in Outlook 2003 deleted items folder? | Balthazar | Outlook - Installation | 2 | June 7th 06 04:05 PM |
Restrict method problem | Mike Epp | Outlook and VBA | 2 | April 7th 06 07:03 PM |
MapiFolder Items ItemChange is not firing | AtulSureka | Outlook - Using Forms | 1 | February 6th 06 04:32 PM |