excel send appointment email by button base on today at 2pm,notification period is 10day.

Step01

New Member
Joined
May 21, 2018
Messages
4
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!

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
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,223,909
Messages
6,175,314
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top