assign task programmatically

S

sd

hello

I need to programmatically assign a task.
1.When I assign task & display it,the "To" list appears empty.It is
not refreshed.After send ,When I reopen the same Task for first
time,it still shows empty "To" list but when opened afterwards it
shows "waiting for response from recipient" label.
2.Also when I assign task using "Assign Task" button from ribbon and
add myself to recipient ,it shows message "You can not send the task
to yourself".But when I programmatically assign task using below code
& add myself to recipient list, message is not displayed & task
request is sent.
Is something wrong/missing in below code?


Set ObjSafeTaskItem = CreateObject("Redemption.SafeTaskItem")
If Not ObjSafeTaskItem Is Nothing Then
ObjSafeTaskItem.Item = ObjTaskItem
ObjSafeTaskItem.Save
ObjSafeTaskItem.Recipients.Add (strRecipient)
ObjSafeTaskItem.Recipients.ResolveAll
ObjSafeTaskItem.Assign
ObjSafeTaskItem.Display
'msgbox "1"
ObjSafeTaskItem.Send
Set ObjSafeTaskItem = Nothing
End If
ObjTaskItem.Close olSave
If Not ObjSafeTaskItem Is Nothing Then Set ObjSafeTaskItem = Nothing
If Not ObjTaskItem Is Nothing Then Set ObjTaskItem = Nothing

Thanks
 
K

Ken Slovak - [MVP - Outlook]

When you make changes to a Redemption Safe*Item Outlook knows nothing about
those changes since they were made at the MAPI level. You need to fake
Outlook into thinking something has changed and then save the item after
having made the Safe*Item changes. Usually we use something like
item.Subject = item.Subject to make Outlook think something changed, then we
call Save() on the Outlook item Safe*Item objects have no Save() method so
they pass it through to Outlook.
 

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