Here's a macro to retrieve a Task by its subject line in your default Tasks
folder and set the DueDate property:
Sub UpdateTaskDueDate()
On Error Resume Next
Dim objTask As Outlook.TaskItem, objTaskFolder As Outlook.MAPIFolder
Dim objNS As Outlook.NameSpace, objItems As Outlook.Items
Set objNS = Application.GetNamespace("MAPI")
Set objTaskFolder = objNS.GetDefaultFolder(olFolderTasks)
Set objItems = objTaskFolder.Items.Restrict("[Subject] = 'Task Subject
Text')
If Not objItems.Count = 0 Then
Set objTask = objItems.Item(1)
objTask.DueDate = #12/31/2004#
objTask.Save
End If
Set objNS = Nothing
Set objTaskFolder = Nothing
Set objTask = Nothing
Set objItems = Nothing
End Sub
--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job:
http://www.imaginets.com
Blog:
http://blogs.officezealot.com/legault/
Rick Cassani said:
All,
I've created an Outlook Task from Great Plains via VBA. The application now
calls for the ability to modify the Due Date. Is there a way to identify,
find, and modify the due date on the Task I've already created?
Thanks,
Rick