Hi,
I want to write a new task to Outlook-2003 from a form in Access-2003.
Have tried both Early and Late binding...
Code crashes (Runtime error 91) at line marked "<<<<<error>>>>" (see below.)whether Outlook is running or not...
Any suggestions greatly appreciated.
'Code:Private Sub cmdCreateTask_Click() On Error GoTo Err_cmdCreateTask_Click Dim objOL As Outlook.Application 'Early Binding Dim myItem As Outlook.TaskItem 'Early Binding Dim objSafeTaskItem As Object 'Early Binding Dim myNS As Outlook.NameSpace 'Early Binding 'Dim objOL As Object 'Late Binding 'Dim myItem As Object 'Late Binding 'Dim objSafeTaskItem As Object 'Late Binding 'Dim myNS As Object 'Late Binding Dim blnOlRunning As Boolean Dim timeX As String Dim strVia As String Dim strReg As String 'Save the local Access record. Me.Refresh
Check if Outlook is already running by 'looking for an error when opening
On Error Resume Next
Code:Set objOL = GetObject(, "Outlook.Application") 'If outlook is NOT running, then If Err.Number = 429 Then Err.Clear 'open an instance of Outlook Set objOL = CreateObject("Outlook.application") End If 'Reset error trap On Error GoTo 0 Set myNS = objOL.GetNamespace("MAPI") '<<<<error myNS.Logon ' If there is a date set If Len(Me!ChaseDateCalendar & "") > 0 Then 'Set alert time timeX = "09:00:00" strVia = Trim(Me![cmbContactBy]) & "" (code continues.... snipped for brevity...)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks