Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


help: deleting events in MS Outlook Calendar

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,60335
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> help: deleting events in MS Outlook Calendar
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 help: deleting events in MS Outlook Calendar - 5/17/2008 4:55:26 PM   
  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.
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> help: deleting events in MS Outlook Calendar Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts