Can anyone please help
I am trying to create a calendar appoint with VBA from excel and have been searching for a solution
I've tried a number of codes but nothing seems to work. I'm a bit of a novice so hoping that someone could help me
My current code is below
I get the following message - User defined type not defined with Dim ol As Outlook.Application highlighted
Sub CreateMeeting_Click()
Dim ol As Outlook.Application
'item As AppointmentItem
Set ol = New Outlook.Application
Set item = ol.CreateItem(olAppointmentItem)
'Set the reminder for 8:30 am on input date
item.Start = rDate + TimeValue("8:30")
'Set one hour duration
item.Duration = 60
'appointment subject
item.Subject = "Write your fancy subject line here"
'location description
item.Location = "Somewhere over there"
'body message
item.Body = "What in the world are you doing at this time?"
'set the busy status
item.BusyStatus = olBusy
'reminder before start
item.ReminderMinutesBeforeStart = 15
'reminder activated
item.ReminderSet = True
'duh! save the thing!
item.Save
'garbage collection - kind of...
Set ol = Nothing
Set item = Nothing
'return true
makeReminder = True
End Sub
I am trying to create a calendar appoint with VBA from excel and have been searching for a solution
I've tried a number of codes but nothing seems to work. I'm a bit of a novice so hoping that someone could help me
My current code is below
I get the following message - User defined type not defined with Dim ol As Outlook.Application highlighted
Sub CreateMeeting_Click()
Dim ol As Outlook.Application
'item As AppointmentItem
Set ol = New Outlook.Application
Set item = ol.CreateItem(olAppointmentItem)
'Set the reminder for 8:30 am on input date
item.Start = rDate + TimeValue("8:30")
'Set one hour duration
item.Duration = 60
'appointment subject
item.Subject = "Write your fancy subject line here"
'location description
item.Location = "Somewhere over there"
'body message
item.Body = "What in the world are you doing at this time?"
'set the busy status
item.BusyStatus = olBusy
'reminder before start
item.ReminderMinutesBeforeStart = 15
'reminder activated
item.ReminderSet = True
'duh! save the thing!
item.Save
'garbage collection - kind of...
Set ol = Nothing
Set item = Nothing
'return true
makeReminder = True
End Sub