| |
milon
Posts: 1
Score: 0
Joined: 5/17/2008
Status: offline
|
hey guys, i'm trying to write a script that'll delete events from my calendar in MS Outlook 2003 (working with Exchange server if that matters). the problem is i'm a total newby in vbs, i'd never written any script in it, and i even dont know its syntax. i've been learning a little, and i'm trying to write a script that'll get from the users 2 dates, and will delete all the events between these dates in the calendar. In the beginning i've been trying to write a simple script - that will find the events between 28/05/08 and 01/06/08, and then will show me them, thats what i've succedded to write: Dim ol Dim olns Dim sFilter Dim MyEvents Dim MyEvent Set ol = CreateObject("Outlook.Application") Set olns = ol.GetNamespace("MAPI") Set myFolder = olns.GetDefaultFolder(9) Set MyEvents = myFolder.Items sFilter = "[Start] > '" & Format("28/05/08 0:00Am", "ddddd h:nn AMPM") & "'" And "[Start] < '" & Format("01/06/08 0:00Am", "ddddd h:nn AMPM") & "'" Set MyEvent = MyEvents.Find(sFilter) If MyEvent Is Nothing Then ' the Find failed MsgBox "No Events found!" Else Do While Not MyEvent Is Nothing MsgBox "the subject is: " & MyEvent.Subject & " and its date is: " & MyEvent.Start Set MyEvent = MyEvents.FindNext Loop End If but even that script doesnt work! i totally dont know vbs syntax, so i'm asking for your help in that one. thanks.
|
|