Cannot add email recipient

  • Thread starter Gerry Verschuuren
  • Start date
G

Gerry Verschuuren

I am trying to place a calendar alert in someone else's calendar from Access.
I use the following code based on late binding:

Sub OutlookCalendar(sSubject As String, dAlert As Date, sRecip As String)
Dim oApplic As Object, oAppoint As Object
Const oAppointItem = 1
Set oApplic = CreateObject("Outlook.Application")
Set oAppoint = oApplic.CreateItem(oAppointItem)
oAppoint.Subject = sSubject
oAppoint.Start = DateSerial(Year(dAlert), Month(dAlert), Day(dAlert)) +
TimeSerial(9, 0, 0)
oAppoint.ReminderPlaySound = True
oAppoint.Save
oAppoint.Recipients.Add sRecip
oAppoint.Send
oApplic.Quit
Set oApplic = Nothing
End Sub

Then I call this Sub from Access:
Call OutlookCalendar("Alert", Date, "(e-mail address removed)")

This works fine if I send the alert to my own calednar, but when I try to do
this for someone else's calendar, I get stuck on the line that adds a
recipient.

Does anyone have an idea why?

Thanks so much.

Gerry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top