This shoul work but ıt gives error at .Assign part
Run-time erorr '-2147467259(80004005)'
The task "" is stored as a file, not as an item in Outlook folder,so the requesterd action cannot be performed
eror what did I wrote wrong can you help me
Dim myOlApp As New Outlook.Application
Dim myItem As Outlook.TaskItem
Dim myDelegate As Outlook.Recipient
Dim tsrt As String
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olTaskItem)
myItem.Assign ''' Gives error here
Set myDelegate = myItem.Recipients.Add(tstr)
myDelegate.Resolve
If myDelegate.Resolved Then
With myItem
.Subject = wks.Cells(R, 1).Value
.Body = wks.Cells(R, 7).Value
'.Companies = wks.Cells(R, 5).Value
.DueDate = wks.Cells(R, 12).Value
.ContactNames = wks.Cells(R, 11).Value
.Save
.Send
.Display
End With
End If
Set myItem = Nothing
Set myOlApp = Nothing
Application.ScreenUpdating = True
End Sub
Bookmarks