Hello all,
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:
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 bold is the culprit. I have tried different ways of doing this but it doesn't matter what I do, it code tanks at the Recipients.Add line.
Any suggestions?
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:
Code:
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 [B]Set myDelegate = MyItem.Recipients.Add("Dan Wilson")[/B] myDelegate.Resolve If myDelegate.Resolved Then myItem.Subject = "Prepare Agenda For Meeting" myItem.DueDate = Now + 30 myItem.Display myItem.Send End If End Sub
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 bold is the culprit. I have tried different ways of doing this but it doesn't matter what I do, it code tanks at the Recipients.Add line.
Any suggestions?
Comment