Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-02-2017, 01:53 AM
Tagliaboo Tagliaboo is offline Flags Windows 10 Flags Office 2013
Novice
Flags
 
Join Date: Dec 2014
Posts: 9
Tagliaboo is on a distinguished road
Default Flags


I would like to automatically flag every message that is received on friday for followup, is this possible?
Reply With Quote
  #2  
Old 05-02-2017, 05:08 AM
gmayor's Avatar
gmayor gmayor is offline Flags Windows 10 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

I guess you could use a script to check the day of the week of all incoming messages, using a rule that runs a script to determine if the received time is on a Friday e.g.

Code:
Sub FlagMessage(olItem As Outlook.MailItem)
    With olItem
        If Weekday(.ReceivedTime) = 6 Then
            ' due this week flag
            .MarkAsTask olMarkThisWeek
            ' sets a specific due date
            .TaskDueDate = Now + 3
            .FlagRequest = "Call " & olItem.SenderName
            .ReminderSet = True
            .ReminderTime = Now + 2
            .Save
        End If
    End With
lbl_Exit:
    Exit Sub
End Sub
You can test it by selecting a message that was received on a Friday and run the following macro.

Code:
Sub GetMsg()
Dim olMsg As MailItem
    On Error Resume Next
    Set olMsg = ActiveExplorer.Selection.Item(1)
    FlagMessage olMsg
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
  #3  
Old 05-02-2017, 06:43 AM
Tagliaboo Tagliaboo is offline Flags Windows 10 Flags Office 2013
Novice
Flags
 
Join Date: Dec 2014
Posts: 9
Tagliaboo is on a distinguished road
Default Macros

I copied the code into the VB. How do I test the macros? It is a bit different than excel
Reply With Quote
  #4  
Old 05-02-2017, 06:49 AM
gmayor's Avatar
gmayor gmayor is offline Flags Windows 10 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

Add a module to the project and paste the macro code. Make sure you save the project when you close Outlook.

To test it, select a message delivered on a friday and run GetMsg from the VBA editor.

The main macro is run from an Outlook rule as a script.

You may need to digitally sign the project. See http://www.gmayor.com/create_and_emp...gital_cert.htm
__________________
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
  #5  
Old 05-05-2017, 05:11 AM
Tagliaboo Tagliaboo is offline Flags Windows 10 Flags Office 2013
Novice
Flags
 
Join Date: Dec 2014
Posts: 9
Tagliaboo is on a distinguished road
Default Error with macro

I have attached a screen shot of the error I'm receiving. Any help would be appreciated
Attached Images
File Type: jpg outlook.JPG (107.1 KB, 10 views)
Reply With Quote
  #6  
Old 05-05-2017, 06:18 AM
gmayor's Avatar
gmayor gmayor is offline Flags Windows 10 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

See the link in my previous post re digital certificates. Outlook security is higher than other VBA forms.
__________________
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
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 11:40 PM.


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