A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How do I change all past due tasks to today's date?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 14th 07, 07:09 PM posted to microsoft.public.outlook.program_vba
Mark
external usenet poster
 
Posts: 238
Default How do I change all past due tasks to today's date?

I have a large number of tasks that didn't get done on the assigned date. I
am looking for a way to change all of the past due due dates to today of some
other day in the future. Is there a way I can do this in Outlook 2007?
  #2  
Old December 14th 07, 09:07 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default How do I change all past due tasks to today's date?

Sure can - run the macro below!

Sub DeferSelectedTasks()
On Error Resume Next

Dim objSel As Outlook.Selection
Dim objTask As Outlook.TaskItem
Dim dteDeferred As Date
Set objSel = Application.ActiveExplorer.Selection

If objSel.Count = 0 Then Exit Sub 'nothing selected
If Application.ActiveExplorer.CurrentFolder.DefaultIt emType
olTaskItem Then Exit Sub 'wrong active folder type

dteDeferred = FormatDateTime(InputBox("Enter the date you would like to
change the Due Date to for the selected Task Items:" _
, "Change Due Date", Date), vbShortDate)

If Err.Number 0 Then
'bad date
Exit Sub
End If

For Each objTask In objSel
objTask.DueDate = dteDeferred
objTask.Save
Next

Set objSel = Nothing
Set objTask = Nothing
End Sub

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Mark" wrote:

I have a large number of tasks that didn't get done on the assigned date. I
am looking for a way to change all of the past due due dates to today of some
other day in the future. Is there a way I can do this in Outlook 2007?

  #3  
Old December 14th 07, 11:57 PM posted to microsoft.public.outlook.program_vba
Mark
external usenet poster
 
Posts: 238
Default How do I change all past due tasks to today's date?

Thank you for your prompt response. I copied your script into my Macro's
VBE. I then highlighted the tasks that needed a new due date. However, I
received the following error: Compile Error Syntax Error. This opened the VBE
and the first line, Sub DeferSelectedTasks(), is highlighted in yellow.

I'm new to VBA, and I'm not sure what the problem is. Can you help?

Many thanks.

Mark

"Eric Legault [MVP - Outlook]" wrote:

Sure can - run the macro below!

Sub DeferSelectedTasks()
On Error Resume Next

Dim objSel As Outlook.Selection
Dim objTask As Outlook.TaskItem
Dim dteDeferred As Date
Set objSel = Application.ActiveExplorer.Selection

If objSel.Count = 0 Then Exit Sub 'nothing selected
If Application.ActiveExplorer.CurrentFolder.DefaultIt emType
olTaskItem Then Exit Sub 'wrong active folder type

dteDeferred = FormatDateTime(InputBox("Enter the date you would like to
change the Due Date to for the selected Task Items:" _
, "Change Due Date", Date), vbShortDate)

If Err.Number 0 Then
'bad date
Exit Sub
End If

For Each objTask In objSel
objTask.DueDate = dteDeferred
objTask.Save
Next

Set objSel = Nothing
Set objTask = Nothing
End Sub

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Mark" wrote:

I have a large number of tasks that didn't get done on the assigned date. I
am looking for a way to change all of the past due due dates to today of some
other day in the future. Is there a way I can do this in Outlook 2007?

  #4  
Old December 15th 07, 02:58 AM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default How do I change all past due tasks to today's date?

In the Visual Basic Editor, choose Tools - References. Ensure that the
Visual Basic For Applications and Microsoft Outlook 12.0 Object Library items
are checked.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Mark" wrote:

Thank you for your prompt response. I copied your script into my Macro's
VBE. I then highlighted the tasks that needed a new due date. However, I
received the following error: Compile Error Syntax Error. This opened the VBE
and the first line, Sub DeferSelectedTasks(), is highlighted in yellow.

I'm new to VBA, and I'm not sure what the problem is. Can you help?

Many thanks.

Mark

"Eric Legault [MVP - Outlook]" wrote:

Sure can - run the macro below!

Sub DeferSelectedTasks()
On Error Resume Next

Dim objSel As Outlook.Selection
Dim objTask As Outlook.TaskItem
Dim dteDeferred As Date
Set objSel = Application.ActiveExplorer.Selection

If objSel.Count = 0 Then Exit Sub 'nothing selected
If Application.ActiveExplorer.CurrentFolder.DefaultIt emType
olTaskItem Then Exit Sub 'wrong active folder type

dteDeferred = FormatDateTime(InputBox("Enter the date you would like to
change the Due Date to for the selected Task Items:" _
, "Change Due Date", Date), vbShortDate)

If Err.Number 0 Then
'bad date
Exit Sub
End If

For Each objTask In objSel
objTask.DueDate = dteDeferred
objTask.Save
Next

Set objSel = Nothing
Set objTask = Nothing
End Sub

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Mark" wrote:

I have a large number of tasks that didn't get done on the assigned date. I
am looking for a way to change all of the past due due dates to today of some
other day in the future. Is there a way I can do this in Outlook 2007?

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change the colour of the bar at top of today's date? Chops Outlook - Calandaring 1 July 30th 07 03:52 AM
the today's date on my calender has changed. how do I change back JJ Outlook - Calandaring 1 June 13th 07 07:06 PM
All new appointment appear on today's date bglincoln 1 Outlook - Calandaring 0 May 8th 07 06:22 PM
Can only create appointment for today's date [email protected] Outlook - Calandaring 2 April 20th 07 12:18 AM
How do I print only today's tasks on a calender? lee Outlook - Calandaring 1 January 13th 06 10:34 AM


All times are GMT +1. The time now is 08:25 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.