Outlook 11 object Model

G

Guest

Hi,

I've recently created some code in Access VBA to intergrate some functions
with Outlook. This works great on my PC and others. However, on some PCs I
get an error message:

error -2147024770 (8007007e) the specific module could not be found.

All PCs have Outlook 2003 but I have a mixture of Access 2000 and 2003. I
have the VB working on both Access 2000 and 2003 as I assume the object model
is the same.

I'm guessing something isn't installed on some of the machines, has anyone
else had this problem and do you know how to fix it.

Many thanks in advance.

Iain
 
G

Guest

Check your references in VBA editor (Tools, References). All should have a
references to OutLook 11.
 
G

Guest

Hi thanks for the quick response,

I'm using the same database and opening it on different PCs. The outlook 11
object library is automatically selected as a result. I've just checked on
one computer and it does have the reference to outlook 11 but I still get the
error on that pc.

Is it possible the object library is not installed, even though it appears
in the list?

Iain
 
G

Guest

If it has the reference and it does not say Missing, then it is there. I did
not read the error message carefully enough to notice it can't find a module.
Do you have some code in a standard module your routine calls that is not
included in the mdb on the offending pcs?
 
G

Guest

I have a .mdb which i'm accessing from a network share. I've used two
instances of code to connect 2 different forms to outlook, one is used to
create a outlook task, the other to create an outlook appointment. Both
instances are associated just with a button click event. They don't reference
any other databases or sections of code.

I've run the code again on the offending PCs and when asked pressed the
debug button.

Set objOutlook = CreateObject("Outlook.Application")

is highlighted in yellow.

Here is the code in full for one of the instances:

Private Sub cmdAddAppt_Click()
DoCmd.RunCommand acCmdSaveRecord
If Me!AddedToOutlook = True Then
If MsgBox("This appointment is already added to Microsoft Outlook,
would you like to add it again?", vbYesNo) = vbYes Then
Dim objOutlook As Outlook.Application
Dim objAppt As Outlook.AppointmentItem
Dim objRecurPattern As Outlook.RecurrencePattern
Set objOutlook = CreateObject("Outlook.Application")
Set objAppt = objOutlook.CreateItem(olAppointmentItem)
With objAppt
.Start = Me!ApptStartDate & " " & Me!ApptTime
.Duration = Me!ApptLength
.Subject = Me!Appt
If Not IsNull(Me!ApptNotes) Then .Body = Me!ApptNotes
If Not IsNull(Me!ApptLocation) Then .Location =
Me!ApptLocation
If Me!ApptReminder Then
.ReminderMinutesBeforeStart = Me!ReminderMinutes
.ReminderSet = True
End If
If Me!InviteAttendees = True Then
.MeetingStatus = olMeeting
.RequiredAttendees = Me!Attendees
.Recipients.ResolveAll
.Save
.Send
Else
.Save
End If
.Close (olSave)
End With
'Release the AppointmentItem object variable.
Set objAppt = Nothing
Else
Exit Sub
End If
End If
'Release the object variables.
Set objOutlook = Nothing
Set objRecurPattern = Nothing
'Set the AddedToOutlook flag, save the record, display
'a message.
Me!AddedToOutlook = True
DoCmd.RunCommand acCmdSaveRecord
If Me!InviteAttendees = True Then
MsgBox "Appointment Added and Sent!"
Else
MsgBox "Appointment Added!"
End If
End Sub

As I said though this works on most of the computers, it's just the select
few that are causing me problems. I really want to roll this out to the
company as it will be so beneficially. Is there anything else you cn think of
that might be causing the error?

Iain
 
G

Guest

This is only a guess, but I think it could be a problem with Early binding as
opposed to Late binding. I was having a similar problem with Excel during a
transition period when my company was moving from Office 2000 to Office 2003.
I was advised to use Late binding as a standard to avoid version
differences. The difference is in the way you dim and reference the objects.
Your Dim statement for your Outlook object is causing Early binding. Try
chaning these lines and see if it helps.
Dim objOutlook As Outlook.Application
Dim objAppt As Outlook.AppointmentItem
Dim objRecurPattern As Outlook.RecurrencePattern

Dim objOutlook As Object
Dim objAppt As Object
Dim objRecurPattern As Object
 
G

Guest

Hi,

I tried that but no joy i'm affraid. I've just finished training everyone so
I hope we can find a solution.

Iain
 
G

Guest

I have fixed the problem on my PCs. Basically the error only occured on some
of the machines running Access 2000 and Outlook 2003.

To fix the problem I unistalled outlook and installed it again.

To be clear I tried repair which did not work. I made sure all elements were
installed using change in Add/remove programs which didn't help. I used
reinstall and that did not help. The only way to get it to work was to
uninstall and then install it again.

Thanks for your help on this matter.
Iain
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top