Consulting

Results 1 to 2 of 2

Thread: Macro to set custom reminder times.

  1. #1

    Macro to set custom reminder times.

    Let me preface with I am new to the possibilities of programming with VBA and the Office programs. That being said, once I realized what was possible, I got very excited. I am also new to the forum so please excuse any mistakes or breaks from protocol that I might make.

    I want to run a macro using a keyboard shortcut that will set a custom reminder time. Start date, due date, and reminder time will all be the same. I also want to replicate the code to be able to set multiple reminder times. So, for example, I want to be able to choose a reminder time of 1 day, 2 days, 3 days, 5 days, 7 days, or 14 days. Preferably these would all be different macros with different shortcuts, so I would be able to choose when I want to be reminded based on importance. Thanks for any and all help!

  2. #2
    VBAX Mentor skatonni's Avatar
    Joined
    Jun 2006
    Posts
    347
    Location
    Option Explicit
    
    Private Sub Appt_With_Reminder()
    
        '  If you put this on the Quick Access Toolbar,
        '    the shortcut is:
        '
        '       ALT + designated character(s)
        '
        '  Click ALT and release to see the designated character(s)
        '
        '  Use the numbers across the top of the keyboard not the keypad.
        
        Dim objAppt As AppointmentItem
        
        Set objAppt = CreateItem(olAppointmentItem)
        
        objAppt.Subject = "Reminder test"
        
        objAppt.Start = Now + (1 / 24) / 2  ' (1 day / 24 hours)/ 2 = one half hour from now
        objAppt.End = Now + (1 / 24)        ' (1 day / 24 hours)    = one hour from now
        
        objAppt.ReminderSet = True
        objAppt.ReminderMinutesBeforeStart = 37 ' whole minutes
        
        objAppt.Sensitivity = olPrivate
        objAppt.Display
        
    End Sub
    To debug, mouse-click anywhere in the code. Press F8 repeatedly to step through the code. http://www.cpearson.com/excel/DebuggingVBA.aspx

    If your problem has been solved in your thread, mark the thread "Solved" by going to the "Thread Tools" dropdown at the top of the thread. You might also consider rating the thread by going to the "Rate Thread" dropdown.

Posting Permissions

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