Marking a Task Completed for another User

L

Lor

I am using Outlook 2003 with Exchange and am trying to programatically mark a
task as completed.

The simple code I have is:

Sub MarkComplete()

Set myItem =
Application.Session.GetDefaultFolder(olFolderTasks).Items("This is the
subject of my task")
myItem.MarkComplete

End Sub

This works if I am doing it for my own account, however, how do I mark a
task as completed on another account (I have the proper permissions set to do
this; the other account is listed under "Other Tasks" while in the tasks
window).

Thank you for any help.
Lor
 
L

Lor

Dmitry,

Thanks for the help. The final code that I used was:

Function MarkComplete()

Dim myOlApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myRecipient As Outlook.Recipient
Dim myItem As Outlook.TaskItem
Dim myTask As String

Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myRecipient = myNamespace.CreateRecipient("Jane Smith")
myRecipient.Resolve
myTask = "Subject Name of Task"
Set myItem =
Outlook.Application.Session.GetSharedDefaultFolder(myRecipient,
olFolderTasks).Items(myTask)
myItem.MarkComplete

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top