#1
|
|||
|
|||
Automatic Flags
Hi
I find flagging emails incredibly useful - when I remember to do it - especially for follow up purposes. Unfortunately, I often forget to flag an email I just sent - is there any way to be prompted whether I want to flag a sent email? Cheers |
#2
|
||||
|
||||
You cannot flag a message until after it has been sent and appears in the Sent Items folder. You can intercept it there and choose whether to flag it using macros in the ThisOutlookSession folder of Outlook.
You will either have to run the macro Application_Startup manually or restart Outlook to run it. It then checks when items are added to the sent items folder, checks that they are messages and established whether they are already flagged or not. If not it will prompt to ask if you want to set a flag to the message with the subject and recipient named in the message, then either set a flag or not as chosen. Code:
Option Explicit Private WithEvents Items As Outlook.Items Private Sub Application_Startup() SetItems lbl_Exit: Exit Sub End Sub Public Sub SetItems() Set Items = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderSentMail).Items lbl_Exit: Exit Sub End Sub Private Sub items_ItemAdd(ByVal Item As Object) If TypeName(Item) = "MailItem" Then If Not Item.IsMarkedAsTask = True Then If MsgBox("Subject: " & Item.Subject & vbCr & _ "To: " & Item.To & vbCr & vbCr & _ "Message is not flagged. Do you wish to flag the message?", vbYesNo) = vbYes Then Item.MarkAsTask olMarkNoDate Item.Save End If End If End If lbl_Exit: Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Flags | Tagliaboo | Outlook | 5 | 05-05-2017 06:18 AM |
Changing color font between 2 specific flags | RupertM | Word VBA | 4 | 05-24-2014 04:47 AM |
moving follow up flags - outlook 2003 | Newmarket2 | Outlook | 0 | 01-13-2013 04:46 PM |
automatically manage flags | zolw | Outlook | 0 | 12-19-2010 03:58 PM |
Document flags nearly all words | Jan Te Lagen | Word | 0 | 02-22-2010 09:07 AM |