PDA

View Full Version : Auto-set followup/reminder popup box for ALL sent emails.



lordterrin
12-12-2013, 11:08 AM
I'm familiar with VBA in Excel and do a lot of programming there, but I've never tried my hand in Outlook.

I'd like to add something into outlook so that each time I send an email, a window pops up and asks me whether or not I want to set a reminder for myself on that email using the built-in reminder follow-up tool from Outlook (since I send a lot, and forget that I need to follow up)

Is this possible?

I apologize - normally I would paste in my code, but with Outlook, I'm not even sure where to start.

skatonni
12-13-2013, 03:12 PM
If there is a way to invoke the dialog box, someone else has to answer.

You can revise this code to cancel the send.

If MsgBox("Set a reminder.", vbYesNo) = vbYes Then Cancel = True

Or use as is to set a follow up date.


Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

Dim NumDays As Double
Dim uPrompt As String

If Item.ReminderTime = "4501-01-01" Then

If MsgBox("Set a reminder.", vbYesNo) = vbYes Then
uPrompt = "Follow-Up how many days from now. Decimals allowed."

On Error GoTo noInput
NumDays = InputBox(Prompt:=uPrompt, Default:=3)
On Error GoTo 0

With Item
.FlagStatus = olFlagMarked ' <- deprecated
.ReminderTime = Now + NumDays
.FlagRequest = "Must action!"
.Save
End With

End If
End If
Exit Sub

noInput:
Cancel = True
MsgBox "Cancel or non valid days entry."
End Sub

The code goes in the "ThisOutlookSession" module.

Reference http://msdn.microsoft.com/en-us/library/bb610089%28v=office.12%29.aspx

Alternative http://www.outlookforums.com/threads/90421-vba-dialog-box-when-sending-email/

lordterrin
12-17-2013, 08:04 AM
Thanks skatonni for your help on this!