This code worked for me.
Sub CreateNewTask()
Dim ol As Outlook.Application
Dim NewTask As Outlook.TaskItem
Dim recip As Outlook.Recipient
Set ol = New Outlook.Application ' or
createobject("Outlook.Application")
Set NewTask = ol.CreateItem(olTaskItem)
NewTask.Assign
Set recip =
NewTask.Recipients.Add("Drug_Projects_Queue@sterlingtesting.com")
recip.Resolve
If recip.Resolved Then
With NewTask
.DueDate = #11/21/2007#
.Subject = "Test Subject"
.StartDate = #11/21/2007#
.Display
.Send
End With
Else
MsgBox "Couldn't resolve recipient!", vbCritical
Exit Sub
End If
End Sub
HTH,
JP
On Nov 20, 6:58 am, scott56hannah
<scott56han...@discussions.microsoft.com> wrote:
> Hi,
>
> <I have already posted this in the excel forum and has been suggested to
> post here>
>
> I am using the CreateItem method to send tasks to other users and it does
> not register those tasks for the recieving user.
>
> It sends the email as a task with all the details. Registering that task in
> the senders task list but when it gets to the receivers email it will not
> open or register the task into the receivers task list...
>
> I have included the code I am currently using to create and send the tasks...
>
> Dim myOlApp As New Outlook.Application
> Dim myItem As Outlook.TaskItem
> Dim myDelegate As Outlook.Recipient
>
> Set myItem = myOlApp.CreateItem(olTaskItem)
> myItem.Assign
>
> Set myDelegate = myItem.Recipients.Add("t...@intelexcel.com.au")
> myDelegate.Resolve
>
> If myDelegate.Resolved Then
> myItem.Subject = "Task sent from Excel routine"
> myItem.DueDate = Now + 30
> myItem.Status = olTaskNotStarted
> myItem.Categories = "Excel"
> myItem.Body = "Test Body"
> myItem.Importance = olImportanceHigh
> myItem.Display
> myItem.Send
> End If
>
> Any help on this is appreciated...
>
> Note : I have tried to send a task using Outlook directly and it also does
> not seem to work properly...
>
> Scott