Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-07-2019, 07:35 AM
goozer321 goozer321 is offline Automatic Flags Windows 10 Automatic Flags Office 2016
Novice
Automatic Flags
 
Join Date: Aug 2019
Posts: 1
goozer321 is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 08-07-2019, 11:21 PM
gmayor's Avatar
gmayor gmayor is offline Automatic Flags Windows 10 Automatic Flags Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes


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

Other Forums: Access Forums

All times are GMT -7. The time now is 02:15 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft