Hello. I am trying to write some VB Script code to interface with two outlook 2000 calendars. I can write the code to interface with one calendar fine, but I am unable to write the code to interface with more the one calendar. I have got code which does allow me to interface with two inboxs, but when I try to modify it to work with calendars instead it fails. On code 2 it fails on line 4 "object or property does not support this method"
Any ideas on if what I am doing is possible and if so, how I can get it to work?
CODE 1 - Code that does work and does interface with two mailboxes
Set oSession = CreateObject("MAPI.Session")
oSession.Logon "", "", False, True, 0, True, "SERVER" & vbLf & "MAILBOX"
Set Inbox = oSession.Inbox
Set Messages = Inbox.Messages
CODE 2 - Code that attempts to interface with one of the calendars but fails
Set oSession = CreateObject("MAPI.Session")
oSession.Logon "", "", False, True, 0, True, "SERVER" & vbLf & "MAILBOX"
Set Calendar = oSession.GetDefaultFolder(2)
Set Messages = Calendar.items
Any ideas on if what I am doing is possible and if so, how I can get it to work?
CODE 1 - Code that does work and does interface with two mailboxes
Set oSession = CreateObject("MAPI.Session")
oSession.Logon "", "", False, True, 0, True, "SERVER" & vbLf & "MAILBOX"
Set Inbox = oSession.Inbox
Set Messages = Inbox.Messages
CODE 2 - Code that attempts to interface with one of the calendars but fails
Set oSession = CreateObject("MAPI.Session")
oSession.Logon "", "", False, True, 0, True, "SERVER" & vbLf & "MAILBOX"
Set Calendar = oSession.GetDefaultFolder(2)
Set Messages = Calendar.items