Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resolving calendar recipients

Status
Not open for further replies.

emozley

Technical User
Jan 14, 2003
769
GB
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top