NauticalGent
Ignore List Poster Boy
- Local time
- Today, 05:44
- Joined
- Apr 27, 2015
- Messages
- 6,749
Hello again,
I am using Access/Office 2010 on a Windows 7 platform.
What I am trying to do sounds simple: I want to assign an Outlook Task to the individual selected in a form's combo box.
Here is my code that I took from an MSDN site:
Sub AssignedTech_AfterUpdate()
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("Dan Wilson")
myDelegate.Resolve
If myDelegate.Resolved Then
myItem.Subject = "Prepare Agenda For Meeting"
myItem.DueDate = Now + 30
myItem.Display
myItem.Send
End If
End Sub
I do have the Microsoft Outlook 14.0 Object Library referenced and I got a clean compile prior to running the code.
When I select the intended recipients name, I get a "Run-Time Error "287" Application-Defined or Object-Defined Error"
When I debug the code, the portion in red is the culprit.
I found a similar thread on here that had over 65 responses and everything was suggested up to and including human sacrifices. However, there was no resolution or "eureka" moment that I could see.
Open to any and all suggestions, up to and including human sacrifice...
I am using Access/Office 2010 on a Windows 7 platform.
What I am trying to do sounds simple: I want to assign an Outlook Task to the individual selected in a form's combo box.
Here is my code that I took from an MSDN site:
Sub AssignedTech_AfterUpdate()
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("Dan Wilson")
myDelegate.Resolve
If myDelegate.Resolved Then
myItem.Subject = "Prepare Agenda For Meeting"
myItem.DueDate = Now + 30
myItem.Display
myItem.Send
End If
End Sub
I do have the Microsoft Outlook 14.0 Object Library referenced and I got a clean compile prior to running the code.
When I select the intended recipients name, I get a "Run-Time Error "287" Application-Defined or Object-Defined Error"
When I debug the code, the portion in red is the culprit.
I found a similar thread on here that had over 65 responses and everything was suggested up to and including human sacrifices. However, there was no resolution or "eureka" moment that I could see.
Open to any and all suggestions, up to and including human sacrifice...