How would I go about writing code so that when you respond "Yes" to a prompt when sending messages, the message is automatically converted to an AppointmentItem? And for that appointment to be, say, 2 days later at 13:00.

Here is the relevant part of the code I have so far. The prompt I have is "do you want to mark this message for follow up". Need both to mark message and to add to calendar when you click yes - (got the first part). The **** indicate areas which I am struggling with.

Many thanks in advance

(Note: New to VBA. If existing info out there and I've missed it, pls point me to it)



prompt$ = "Do you want to flag this message for followup?"If MsgBox(prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Add flag?") = vbYes Then
With item
.MarkAsTask olMarkThisWeek
' sets a due date in 3 days
.TaskDueDate = Now + 2
.ReminderSet = True
.ReminderTime = CDate(.TaskDueDate) & " " & TimeValue("13:00:00")
.Save
End With


With Item
****some way of referring to TaskItem from above*** (Maybe  need to keep within "With Item...End With" above?)*****
****convert taskitem to appointmentitem ****
***Keep Subject of Email as name of appointment ie task item name***
***In non -default calendar****



Appointment date = Now + 2
ReminderSet=True
ReminderTime=CDate(.TaskDueDate) & " " & TimeValue("13:00:00")
End With
End If