Hi,
I am trying to send outlook calendar entries using vbscript - the only problem I've got is if the recipient does not exist I can put in error handling so the script does not fall over but ideally I would like to make it so Outlook asks the user for further input - a bit like if you type in a recipient's name and there are say 3 matches it will offer them and then you can select them.
My code so far is:
Const olAppointmentItem = 1
Const olMeeting = 1
Const OlRequired = 1
Const olRecursWeekly = 1
Set objOutlook = CreateObject("Outlook.Application")
Set objAppointment = objOutlook.CreateItem(olAppointmentItem)
objAppointment.Start = #5/5/2009 11:00 AM#
objAppointment.Duration = 60
objAppointment.MeetingStatus = olMeeting
objAppointment.Subject = "Test"
objAppointment.Body = "Test"
objAppointment.Location = "Test"
objAppointment.ReminderMinutesBeforeStart = 15
objAppointment.ReminderSet = True
Set colRecipients = objAppointment.Recipients
AllNamesResolved=True
Set objRecipient = colRecipients.Add("mozleye")
objRecipient.Type = olRequired
If Not objRecipient.Resolved Then
AllNamesResolved=False
End If
If AllNamesResolved=True Then
objAppointment.Send
Else
wscript.Echo("It was not possible to send the calendar entry")
End If
wscript.echo("Done")
Thanks very much
Ed
I am trying to send outlook calendar entries using vbscript - the only problem I've got is if the recipient does not exist I can put in error handling so the script does not fall over but ideally I would like to make it so Outlook asks the user for further input - a bit like if you type in a recipient's name and there are say 3 matches it will offer them and then you can select them.
My code so far is:
Const olAppointmentItem = 1
Const olMeeting = 1
Const OlRequired = 1
Const olRecursWeekly = 1
Set objOutlook = CreateObject("Outlook.Application")
Set objAppointment = objOutlook.CreateItem(olAppointmentItem)
objAppointment.Start = #5/5/2009 11:00 AM#
objAppointment.Duration = 60
objAppointment.MeetingStatus = olMeeting
objAppointment.Subject = "Test"
objAppointment.Body = "Test"
objAppointment.Location = "Test"
objAppointment.ReminderMinutesBeforeStart = 15
objAppointment.ReminderSet = True
Set colRecipients = objAppointment.Recipients
AllNamesResolved=True
Set objRecipient = colRecipients.Add("mozleye")
objRecipient.Type = olRequired
If Not objRecipient.Resolved Then
AllNamesResolved=False
End If
If AllNamesResolved=True Then
objAppointment.Send
Else
wscript.Echo("It was not possible to send the calendar entry")
End If
wscript.echo("Done")
Thanks very much
Ed