set a flag task date as the next weekday

SiSept

New Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Not quite sure how to technically describe the task. No VBA experience but looking for a macro that will give an option to set a flag task date as the next monday, tuesday, wednesday, thursday, friday. Grateful for any help. Outlook 2007.
 

SiSept

New Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Not quite sure how to technically describe the task. No VBA experience but looking for a macro that will give an option to set a flag task date as the next monday, tuesday, wednesday, thursday, friday. Grateful for any help. Outlook 2007.
Don't think I have worded the thread title correctly. Should be "a" weekday rather than "the next" weekday
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
See the sample for Outlook 2007 here:
Flag an Email for Follow-up - VBOffice

See also the sample for how to call the function. Easiest is to have seven such functions. On systems where monday is the first day of the week, this one is for next tuesday:
Public Sub NextTuesday()
MarkItemAsTask 2-weekday(date,vbUseSystemDayOfWeek)
End Sub

This one for next wednesday (note the changing first figure)
Public Sub NextWednsesday()
MarkItemAsTask 3-weekday(date,vbUseSystemDayOfWeek)
End Sub

You can complete it yourself. For sunday the figure is 7. And this one is for next monday:
Public Sub NextWednsesday()
MarkItemAsTask 8-weekday(date,vbUseSystemDayOfWeek)
End Sub
 

SiSept

New Member
Outlook version
Outlook 2007
Email Account
Exchange Server
thanks for replying but I don't really understand. I have managed to get it to set a Tuesday but in Jan 1900

Sub NextTuesday(NextTuesday)
Sub SetfollowupTuesdayMacro()

Dim Sel As Outlook.Selection
Set Sel = Application.ActiveExplorer.Selection

Dim Item As Object
Dim j As Integer

For j = 1 To Sel.count
Set Item = Sel.Item(j)
If Item.Class = olMail Then
Dim Mail As MailItem
Set Mail = Item
Mail.MarkAsTask 3 - Weekday(Date, vbUseSystemDayOfWeek)
Mail.TaskStartDate = 3
Mail.Save
End If

Next j

End Sub
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Copy all the sample. The first two, MarkItemAsTask and GetCurrentItems, are missing. Then use the samples shown above to call the MarkItemAsTask function.
 

Similar threads

Top