Consulting

Results 1 to 2 of 2

Thread: Excel VBA to Outlook canlendar set reminder

  1. #1

    Excel VBA to Outlook canlendar set reminder

    I have this VBA code performing after a click of a button:

    Dim ol As Outlook.Application
    Dim olAp As Outlook.AppointmentItem

    Set ol = New Outlook.Application
    Set olAp = ol.CreateItem(olAppointmentItem)

    With olAp
    .Subject = Cells(7, 2) & " - " & Cells(7, 4) & " - " & Cells(7, 5)
    .Location = Cells(7, 3)
    .Start = Cells(7, 16)
    .AllDayEvent = True
    .ReminderSet = True
    .ReminderMinutesBeforeStart = 4320
    .body = Cells(7, 19)
    .display
    End With

    The objective is that automatically the reminder is set to 3 days before the appoitment.

    However Outlook Calendar keeps the reminder at 18h.

    How can I solve this?

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Welcome to the forum!

    All day events have an issue setting the reminder that long. You may have an issue with your start time.

    A workaround like this might meet your needs. I used start date as 4 days from current date.
    Sub SetReminder()  Dim ol As Outlook.Application
      Dim olAp As Outlook.AppointmentItem
      Dim d As Double
      
      Set ol = New Outlook.Application
      Set olAp = ol.CreateItem(olAppointmentItem)
       
      With olAp
        .Subject = Cells(7, 2) & " - " & Cells(7, 4) & " - " & Cells(7, 5)
        .Location = Cells(7, 3)
        d = Now + 4 * 24
        d = DateSerial(Year(d), Month(d), Day(d))
        .Start = d 'Cells(7, 16)
        .End = d + TimeSerial(23, 59, 0)
        .AllDayEvent = False
        '.AllDayEvent = True
        .ReminderMinutesBeforeStart = 3 * 24 * 60
        .ReminderSet = True
        .body = Cells(7, 19)
       .display
      End With
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •