i am trying to use excel vba to send an email that is included appoiment but it look like got some error.have anyone got this idea?
email are require to send out on today at 2pm for notification 10 day.
Thanks!
email are require to send out on today at 2pm for notification 10 day.
Thanks!
Code:
Option Explicit
Sub Button1_Click()
Dim myoutlook As Object
Dim myapt As Object
Const olAppointmentItem = 1
Const olBusy = 2
Const olMeeting = 1
Set myoutlook = CreateObject("Outlook.Application")
Set myapt = myoutlook.CreateItem(olAppointmentItem)
With myapt
.Subject = "EXAMPLE"
'.Start = date 2:00 PM
'.Duration = 0
.Recipients.Add "example@hotmail.com"
.MeetingStatus = olMeeting
'.BusyStatus = olBusy
.ReminderSet = True
'.ReminderMinutesBeforeStart = 0
.Body = "this is an example"
.Send
End With
End Sub