Macro to record what time it is

Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#1
I'm looking for a macro that would have a start and stop button; when pressing the start button the macro would record what time it is; when pressing the stop button it would record what time it is again; then create a new appointment item on the calendar, push both of those fields (start time and end time) to a new appointment item on the calendar, and allow me to record the subject and notes and save the item.
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#2
Try this:

Code:
Dim dStart

Sub startTime()
dStart = Now
End Sub

Sub endTime()

Dim oAppt As AppointmentItem
Set oAppt = Application.CreateItem(olAppointmentItem)
With oAppt
  .Start = dStart
  .End = Now
  .Display
End With


End Sub
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#3
You could use the second macro to create the apt (add Now as the Start time too) then either use the other macro to set the end time or click in the time field and type now. This would allow you to take notes during the appointment.


Code:
Dim oAppt As AppointmentItem

Sub ApptStart()
Set oAppt = Application.CreateItem(olAppointmentItem)
With oAppt
  .Start = Now
  .End = Now
  .Display
End With

End Sub

Sub apptEnd()
oAppt.End = Now
End Sub
 

Similar threads

Top