![]() |
|
|
|
#1
|
|||
|
|||
|
I would like to automatically flag every message that is received on friday for followup, is this possible?
|
|
#2
|
||||
|
||||
|
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
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 |
|
#3
|
|||
|
|||
|
I copied the code into the VB. How do I test the macros? It is a bit different than excel
|
|
#4
|
||||
|
||||
|
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 |
|
#5
|
|||
|
|||
|
I have attached a screen shot of the error I'm receiving. Any help would be appreciated
|
|
#6
|
||||
|
||||
|
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 |
|
|
|
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 |