![]() |
| 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. |
|
|||||||
| Tags: appointments, chronologically, sorting |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I am using the following code to loop through all the appointment in Outlook
*** Dim objOL As Outlook.Application Dim objNS As Outlook.NameSpace Dim objCalendarFolder As Outlook.MAPIFolder Dim objItems As Outlook.Items Dim objAppt As Outlook.AppointmentItem Set objOL = New Outlook.Application Set objNS = objOL.GetNamespace("MAPI") Set objCalendarFolder = objNS.GetDefaultFolder(olFolderCalendar) Set objItems = objCalendarFolder.Items.Restrict("[Start] = '" & Format(Date, "ddddd h:nn AMPM") & "'") For Each objAppt In objItems ... *** It does work, but is there a way to control the chrononlogical order of the returned appointments? Is there a way to sort the ObjItems Assending/Descending depending on my needs? Thank you, Daniel P |
| Ads |
|
#2
|
|||
|
|||
|
How about using the Items.Sort() method?
Look up the arguments for that method in the Object Browser Help, you can sort on a property and make it ascending or descending. -- 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 "Daniel" wrote in message ... I am using the following code to loop through all the appointment in Outlook *** Dim objOL As Outlook.Application Dim objNS As Outlook.NameSpace Dim objCalendarFolder As Outlook.MAPIFolder Dim objItems As Outlook.Items Dim objAppt As Outlook.AppointmentItem Set objOL = New Outlook.Application Set objNS = objOL.GetNamespace("MAPI") Set objCalendarFolder = objNS.GetDefaultFolder(olFolderCalendar) Set objItems = objCalendarFolder.Items.Restrict("[Start] = '" & Format(Date, "ddddd h:nn AMPM") & "'") For Each objAppt In objItems ... *** It does work, but is there a way to control the chrononlogical order of the returned appointments? Is there a way to sort the ObjItems Assending/Descending depending on my needs? Thank you, Daniel P |
|
#3
|
|||
|
|||
|
I will take a look! Thank you for putting me on the right path.
Daniel P "Ken Slovak - [MVP - Outlook]" wrote: How about using the Items.Sort() method? Look up the arguments for that method in the Object Browser Help, you can sort on a property and make it ascending or descending. -- 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 "Daniel" wrote in message ... I am using the following code to loop through all the appointment in Outlook *** Dim objOL As Outlook.Application Dim objNS As Outlook.NameSpace Dim objCalendarFolder As Outlook.MAPIFolder Dim objItems As Outlook.Items Dim objAppt As Outlook.AppointmentItem Set objOL = New Outlook.Application Set objNS = objOL.GetNamespace("MAPI") Set objCalendarFolder = objNS.GetDefaultFolder(olFolderCalendar) Set objItems = objCalendarFolder.Items.Restrict("[Start] = '" & Format(Date, "ddddd h:nn AMPM") & "'") For Each objAppt In objItems ... *** It does work, but is there a way to control the chrononlogical order of the returned appointments? Is there a way to sort the ObjItems Assending/Descending depending on my needs? Thank you, Daniel P |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Appointments - Sorting | nikki | Outlook - Calandaring | 1 | August 15th 07 06:25 AM |
| Sorting | vortex2k4 | Outlook and VBA | 1 | July 19th 06 01:52 PM |
| Sorting doesn't work | Peter Kim | Outlook - Using Contacts | 3 | February 15th 06 05:31 PM |
| grouping / sorting | Stuart | Outlook - Using Contacts | 2 | February 4th 06 12:43 PM |
| How does OE6 do second level sorting? | D. W. K. | Outlook Express | 8 | January 17th 06 11:07 PM |