![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Hi,
I'd really appreciate some help with this... I'm wanting to write a new TASK to Outlook-2003 from a form in Access-2003. Have tried both Early and Late binding... (see dims) Code crashes (Runtime error 91) at line marked "error" (see below.) whether Outlook is running or not... Any suggestions greatly appreciated. Many thanks David ================================================== ==== 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 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...) |
#2
|
|||
|
|||
![]()
Check to see if objOL Is Nothing. I bet you're running some script stopper
program from an A-V package or software firewall that's preventing CreateObject or GetObject from running. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Blogd_Node" wrote in message u... Hi, I'd really appreciate some help with this... I'm wanting to write a new TASK to Outlook-2003 from a form in Access-2003. Have tried both Early and Late binding... (see dims) Code crashes (Runtime error 91) at line marked "error" (see below.) whether Outlook is running or not... Any suggestions greatly appreciated. Many thanks David ================================================== ==== 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 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...) |
#3
|
|||
|
|||
![]()
Hi Ken,
Thanks for the reply. objOL is nothing. Disabled NAV and ZoneAlarm, but no difference... ?? Any further clues ?? Thanks - David "Ken Slovak - wrote Check to see if objOL Is Nothing. I bet you're running some script stopper program from an A-V package or software firewall that's preventing CreateObject or GetObject from running. "Blogd_Node" wrote in message u... Hi, I'd really appreciate some help with this... I'm wanting to write a new TASK to Outlook-2003 from a form in Access-2003. Have tried both Early and Late binding... (see dims) Code crashes (Runtime error 91) at line marked "error" (see below.) whether Outlook is running or not... Any suggestions greatly appreciated. Many thanks David ================================================== ==== 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 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...) |
#4
|
|||
|
|||
![]()
No, I'd look for anything that might be running a script stopper, those are
the classic symptoms. Norton can be as hard as a virus to disable, and that would be my #1 suspect in any case. Make sure it really is disabled and that the script stopper in it isn't running. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Blogd_Node" wrote in message u... Hi Ken, Thanks for the reply. objOL is nothing. Disabled NAV and ZoneAlarm, but no difference... ?? Any further clues ?? Thanks - David |
#5
|
|||
|
|||
![]()
SOLVED -ANSWER- FIXED -Found -solution
and various other keywords :-) Hi Ken, I used REGMON to check registry calls. Instead of "outlook.application" which was failing, the call should be to "outlook.application.11" (HKCR\Outlook.Application.11) Changing -------------------------------- Set objOL = GetObject(, "Outlook.Application") and Set objOL = CreateObject("Outlook.application") TO--------------------------------------- Set objOL = GetObject(, "Outlook.Application.11") and Set objOL = CreateObject("Outlook.application.11") All now works ! :-) Now, anyone like to explain why ? Many thanks David ================================================= "Ken Slovak - [MVP - Outlook]" wrote in message ... No, I'd look for anything that might be running a script stopper, those are the classic symptoms. Norton can be as hard as a virus to disable, and that would be my #1 suspect in any case. Make sure it really is disabled and that the script stopper in it isn't running. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Blogd_Node" wrote in message u... Hi Ken, Thanks for the reply. objOL is nothing. Disabled NAV and ZoneAlarm, but no difference... ?? Any further clues ?? Thanks - David |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Creating a link to an e-mail in a task | [email protected] | Outlook and VBA | 1 | November 14th 06 06:03 AM |
Creating an Outlook Task Add-in Solution using AdvancedSearch in C | Tom_in_Atlanta | Add-ins for Outlook | 2 | September 12th 06 02:14 AM |
Help with Code - Creating Status Report from Task items | Steve | Outlook and VBA | 1 | August 2nd 06 05:45 AM |
Creating Task sometimes collapses group | T. Wise | Outlook - General Queries | 3 | July 14th 06 04:46 AM |
Adding an Outlook task from Access | Blogd_Node | Outlook and VBA | 6 | June 7th 06 04:33 PM |