![]() |
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
|
|||
|
|||
![]()
Very slightly modified from an example from the Outlook VBA Help on
Items.Restrict. Always use the Object Browser to look for examples and sample code: Public Sub ApptDateCheck() Dim myNamespace As Outlook.NameSpace Dim myAppts As Outlook.Items Dim myItems As Outlook.Items Dim myItem As Object Dim i As Long Dim DateStart As Date DateStart = Date Set myNamespace = Application.GetNamespace("MAPI") Set myAppts = myNamespace.GetDefaultFolder(olFolderCalendar).Ite ms Set myItems = myAppts.Restrict("[End] """ & DateStart & """") For i = myItems.Count To 1 Step -1 Set myItem = myItems.Item(i) If (myItem.Class = olAppointment) Then myItem.Delete End If Next End Sub -- 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 "Orion Cochrane" wrote in message ... Can you give me the code to do that? -- I am running on Office 2003, unless otherwise stated. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook Automatically Deleting Emails | Steve Perrins | Outlook - General Queries | 5 | May 22nd 09 09:52 AM |
When i open an existing appointment in Outlook Calendar, then close, it automatically creates an unwanted recurring appointment. | David H | Outlook - Calandaring | 1 | June 28th 07 10:32 AM |
Outlook deleting comments automatically | Russ G | Outlook - Installation | 0 | February 9th 07 10:01 PM |
Junk e-mail not deleting automatically | Penny Miller | Outlook - General Queries | 2 | November 20th 06 04:47 PM |
Outlook Automatically Deleting Messages? | [email protected] | Outlook - General Queries | 1 | January 31st 06 07:21 PM |