| | Awarded by Microsoft since 2005: |  |
| | VBOffice Info | | Visitors | 1409269 | | Impressions | 5189812 |
| |
|
| |
| Author: Michael Bauer | Homepage | | Date: 17.10.2008 | Accessed: 15516 | | | | Description
Do you also have your rules for flagging e-mails for follow-up? For instance, less urgent items for "this evening"; see whether or not the customer has answered yet for "next week", etc.
This VBA sample does a lot of the necessary work for you; without that especially selecting a date and time would take much of your valuable time.
The sample comes with three options, "this evening" (7 p.m.), "tomorrow" (7 p.m. as well), and "next week" (8 a.m.). Of course, you might want to customize the times and colors. You may even change the default message by writing your own text to the Mail.FlagRequest property.
As always, for calling the functions right click a toolbar, click Customize, Macros, and drag the available macro names to the toolbar. |
Public Enum FlagWhatEnum
flNextWeek = 0
flThisEvening = 1
flTomorrow = 2
End Enum
Public Sub FlagNextWeek()
FlagItem flNextWeek
End Sub
Public Sub FlagThisEvening()
FlagItem flThisEvening
End Sub
Public Sub FlagTomorrow()
FlagItem flTomorrow
End Sub
Private Sub FlagItem(FlagWhat As FlagWhatEnum)
Dim Mail As Outlook.MailItem
Dim obj As Object
Dim Sel As Outlook.Selection
Dim i&
Dim dt As Date
Dim tm As String
Dim Icon As OlFlagIcon
Select Case FlagWhat
Case flNextWeek
dt = DateAdd("d", 7, Date)
tm = CStr(dt) & " 08:00"
Icon = olOrangeFlagIcon
Case flThisEvening
dt = Date
tm = CStr(dt) & " 19:00"
Icon = olYellowFlagIcon
Case flTomorrow
dt = DateAdd("d", 1, Date)
tm = CStr(dt) & " 08:00"
Icon = olYellowFlagIcon
End Select
Set obj = Application.ActiveWindow
If TypeOf obj Is Outlook.Explorer Then
Set Sel = obj.Selection
For i = 1 To Sel.Count
Set obj = Sel(i)
If TypeOf obj Is Outlook.MailItem Then
Set Mail = obj
Mail.FlagDueBy = tm
Mail.FlagIcon = Icon
Mail.Save
End If
Next
Else
Set obj = obj.CurrentItem
If TypeOf obj Is Outlook.MailItem Then
Set Mail = obj
Mail.FlagDueBy = tm
Mail.FlagIcon = Icon
Mail.Save
End If
End If
End Sub
|
| | |
| | |  | ReplyAll alerts you before unintentionally replying all, or if you are a confidential BCC recipient of the ... [more] |
| | |  | Access the master category list in the blink of an eye, share your categories in a network, get a reminder service, and ... [more] |
| | |  | SAM automatically sets the sender, signature, and folder for sent items, for instance based on the recipient ... [more] |
| | |  | OLKeeper reliably prevents users from closing their Outlook window and thus possibly missing reminders or ... [more] |
| |
|