CBragg
VB Dummy
- Local time
- Today, 20:35
- Joined
- Oct 21, 2002
- Messages
- 89
I have a database set up in access which allows you to create tasks and send them to recipients using VB Code.
When sending the task it comes up with this Error Message
"The Task "Task Name" is stored as a file, not as an item in an Outlook folder, so the requested action could not be performed"
This is a short version of my code:
Private Sub Command2_Click()
On Error GoTo Err_Handler
Dim NameSpace As Object
Dim EmailSend As TaskItem 'for the task item add outlook reference
Dim EmailApp As Object
Set EmailApp = CreateObject("Outlook.Application") 'Outlook object
Set NameSpace = EmailApp.getNameSpace("MAPI")
Set EmailSend = EmailApp.CreateItem(3) ' CreateItem(3) Task Item
EmailSend.Subject = "Task Name" 'Task Subject
EmailSend.Body = "Call No: " & Me![RefNo]
EmailSend.Recipients.Add Me![Fixer]
EmailSend.Assign
EmailSend.Send
MsgBox "Message has been sent successfully"
Exit Sub
Err_Handler:
MsgBox Err.Description
End Sub
Any suggestions would be greatly appreciated on either how to get by this problem or what the actual error message is saying.
When sending the task it comes up with this Error Message
"The Task "Task Name" is stored as a file, not as an item in an Outlook folder, so the requested action could not be performed"
This is a short version of my code:
Private Sub Command2_Click()
On Error GoTo Err_Handler
Dim NameSpace As Object
Dim EmailSend As TaskItem 'for the task item add outlook reference
Dim EmailApp As Object
Set EmailApp = CreateObject("Outlook.Application") 'Outlook object
Set NameSpace = EmailApp.getNameSpace("MAPI")
Set EmailSend = EmailApp.CreateItem(3) ' CreateItem(3) Task Item
EmailSend.Subject = "Task Name" 'Task Subject
EmailSend.Body = "Call No: " & Me![RefNo]
EmailSend.Recipients.Add Me![Fixer]
EmailSend.Assign
EmailSend.Send
MsgBox "Message has been sent successfully"
Exit Sub
Err_Handler:
MsgBox Err.Description
End Sub
Any suggestions would be greatly appreciated on either how to get by this problem or what the actual error message is saying.