assign task programmatically

  • Thread starter Thread starter sd
  • Start date Start date
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
 
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.
 
Back
Top