PC Review


Reply
Thread Tools Rate Thread

assign task programmatically

 
 
sd
Guest
Posts: n/a
 
      16th Jun 2009
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
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      16th Jun 2009
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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"sd" <(E-Mail Removed)> wrote in message
news:50d440f8-d219-4314-a7d2-(E-Mail Removed)...
> 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


 
Reply With Quote
 
Tech Expert
Guest
Posts: n/a
 
      26th Jun 2009

Maybe this article will give you an extra information:
http://sysudi.blogspot.com/2009/05/t...g-outlook.html



"sd" <(E-Mail Removed)> wrote in message
news:50d440f8-d219-4314-a7d2-(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assign Index key to field programmatically BmlKidd Microsoft Access 4 30th Oct 2008 09:19 PM
Assign xml map programmatically David Stubbs Microsoft Excel Programming 0 4th Aug 2008 06:39 PM
assign macro to button programmatically Zone Microsoft Excel Programming 2 31st Dec 2007 12:04 AM
Assign Task problem-Can't accept or assign =?Utf-8?B?RE9M?= Microsoft Outlook Calendar 5 29th Jun 2006 06:57 AM
RE: how to programmatically assign text to a label control within a da Microsoft ASP .NET 1 6th Jun 2006 10:40 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:54 PM.