assign task programmatically

  • Thread starter Thread starter sd
  • Start date Start date
Status
Not open for further replies.
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.

"sd" <dshubhangi@gmail.com> wrote in message

news:50d440f8-d219-4314-a7d2-549570770eb4@p5g2000pre.googlegroups.com...
> 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
 
Maybe this article will give you an extra information:

http://sysudi.blogspot.com/2009/05/task-management-using-outlook.html

"sd" <dshubhangi@gmail.com> wrote in message

news:50d440f8-d219-4314-a7d2-549570770eb4@p5g2000pre.googlegroups.com...
> 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
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
F How to assign a task to a public task folder? Using Outlook 1
Diane Poremsky Assign one task to several people Using Outlook 0
E for Mac: Assign Task not available!? Using Outlook 1
C Cannot assign a task from a public folder? Outlook VBA and Custom Forms 4
Z Outlook 365 Automatically assign categories to incoming mail in a shared folder Round Robin Outlook VBA and Custom Forms 1
R Auto Assign Category colours to Incoming Emails based on whom the email is addressed Outlook VBA and Custom Forms 3
R Assign Categories "Round Robin" style but in a shared mailbox but on specific emails only Outlook VBA and Custom Forms 8
P Auto assign shared mailbox Outlook VBA and Custom Forms 1
D Assign categories to outgoing emails Outlook VBA and Custom Forms 0
A How to assign the value returned by the regex execute function to a variable? Using Outlook 1
soadfan assign category (VBA) Using Outlook 7
Diane Poremsky Assign an Email Account to an Outlook Contact Using Outlook 0
E Outlook VBA to print attached Pdf to a fax printer and assign fax number Using Outlook 0
A Assign a unique number to every message I send Using Outlook 0
Z assign unique number email Using Outlook 8
J Assign a signature by external or internal reciepents. Outlook VBA and Custom Forms 1
P VBA to assign category on calendar item does not work ?? why ?? Outlook VBA and Custom Forms 5
C Assign To and CC list while using Redemption.dll library Outlook VBA and Custom Forms 10
C How to assign icon to a button in Outlook Add-in Outlook VBA and Custom Forms 1
sjbtax Update Task Custom Field based upon Task Overdue Status Outlook VBA and Custom Forms 8
B Requesting VBA code to make Outlook prompt for confirmation when deleting a task? Outlook VBA and Custom Forms 4
T Why do Outlook Desktop 2021 tasks from my wife's email show up in my task pane? Using Outlook 2
S Create Outlook Task from Template and append Body with Email Body Outlook VBA and Custom Forms 4
D Copy Appointment Body to Task Body Outlook VBA and Custom Forms 0
K Daily Task List Minimized Cannot Display Using Outlook 5
wayneame Changing the Form Used by Existing Task Items in a Folder Outlook VBA and Custom Forms 4
S Outlook 2016 Understand and customize prepended behavior of recurring task Using Outlook 0
B Outlook 365 Populate Outlook Task UDFs from a UDF text string Outlook VBA and Custom Forms 2
K Multiple copies of task being created Using Outlook 2
P Short Date Format when typing in a task Using Outlook 2
C Outlook 2013 Task Recurrence - Third Friday After the Second Tuesday Using Outlook 2
P Task display now leaves little room for notes Using Outlook 10
C-S-R How to clear an Outlook (To Do) Task Flag? Using Outlook 8
G Event when creating task from mailitem Outlook VBA and Custom Forms 2
P Changing the font that the task view shows Using Outlook 5
D How To Combine Share Task Folders in just one Folder Using Outlook 0
P Can I create a Rule that sends me an email when I get a Task? Using Outlook 2
G Arggh, weakness of reminder for every Task recurrence Using Outlook 0
P Can't paste an image into a task Using Outlook 3
F Validation on custom task form after task acceptance Outlook VBA and Custom Forms 1
J Office 365 erased all of my task views Using Outlook 3
T Report For Task Recurrance Outlook VBA and Custom Forms 4
E Can't accept or decline task (no button appears) Using Outlook 2
Z VBA to convert email to task, insert text of email in task notes, and attach copy of original email Outlook VBA and Custom Forms 4
Z Task Filter Not Working When I add too many criteria Using Outlook 0
X If you change expiration date of repeated task it dupplicates Using Outlook 1
Z How to show concatenated categories in list task view? Using Outlook 2
Z VBA to Collapse Task Folder Groups Outlook VBA and Custom Forms 1
E To convert imported data to custom fields in Task list Outlook VBA and Custom Forms 1
I Help with dates in task list. Using Outlook 5

Similar threads

Back
Top