A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

assign task programmatically



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 16th 09, 03:08 PM posted to microsoft.public.outlook.program_addins
sd[_2_]
external usenet poster
 
Posts: 69
Default assign task programmatically

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
Ads
  #2  
Old June 16th 09, 07:58 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default assign task programmatically

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" wrote in message
...
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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I assign a repeating task? COX Outlook - Calandaring 0 July 19th 07 04:22 PM
Assign Task without Sending Cindy Mikeworth Outlook - General Queries 3 April 22nd 07 02:40 AM
How to assign a Task WITHOUT Exchange rgsiii Outlook - General Queries 1 December 8th 06 06:12 PM
Assign task without an acceptance Jreue Outlook - Using Forms 1 November 1st 06 08:25 PM
Assign Task problem-Can't accept or assign DOL Outlook - Calandaring 5 June 29th 06 07:57 AM


All times are GMT +1. The time now is 09:19 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.