Can anyone please help on this
Ive found some code to insert a calendar event into outlook, ive seen loads and loads of posts with this same code but none of them work
heres the code
VB Code:
Private o1 As New Outlook.Application Public Sub CreateAppointment() 'CreateAppointment(ByVal StartTime As Date, ByVal Endtime As Date, ByVal Subject As String, ByVal Location As String) Try 'Create a reference to a Appointment item Dim e1 As Outlook.AppointmentItem 'Create a new appointment item e1 = o1.CreateItem(olAppointmentItem) 'Set a few of the many possible appointment parameters. e1.Start = CDate("23/01/2004 09:00:00") e1.End = CDate("23/01/2004 10:00:00") e1.Subject = "test" e1.Location = "Bournemouth" 'If you want to set a list of recipients, do it like this 'e1.Recipients.Add Name 'Commit the appointment e1.Send() 'Free up the space e1 = Nothing Catch er As Exception MsgBox(er.ToString) End Try End Sub
i keep getting an error of
"System.InvalidCastExeception: Specified cast is not valid"
ive also found this but havnt tried it as of yet
http://support.microsoft.com/default...;en-us;Q309336
Is this article releated to my problem




Reply With Quote