We help IT Professionals succeed at work.

Check out this week's podcast, "Dairy Farms to Databases: Community's Hand in Technology"Listen Now

x

MSAccess "MISSING: Microsoft Outlook 15.0 Object Library"

darls15
darls15 asked
on
14,569 Views
Last Modified: 2016-04-29
Hi Experts

I have an Access 2010 database which generates a simple email messages with code I came across. Everything was working perfectly until another user opened the database in Access 2013.

I'm now getting errors and in the code window under TOOLS>>REFERENCES I'm getting a "MISSING: Microsoft Outlook 15.0 Object Library" error message.

I'm presuming this is related to the different Outlook versions but due to my lack of knowledge in this area, I really don't know how to fix it or even know if it can be.

Can anyone please advise? I have pasted the code below...

Thanks in advance
darls15


'**************************************************************

Option Compare Database

Public Sub cmdSendAcademyID_Click()
Dim strEmail, strBody As String
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem

'**creates an instance of Outlook
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

'*create string with email address

strEmail = Form__F_SendLogonDetails![EmailAdd]

strBody = strBody & "<FONT Face=Arial Color=#000000 Size=3>"
strBody = strBody & "Dear " & Form__F_SendLogonDetails![txtFName]
strBody = strBody & "<br><br>"
strBody = strBody & "The unique " & " <b> " & "ID" & "</b>" & " for the IT Academy at " & " <b> " & Form__F_SendLogonDetails![Centre Name] & "</b>" & " is " & " <b> " & Form__F_SendLogonDetails![MemberID] & "</b>" & ". Please be aware that you will also need the " & " <b> " & "Program Key" & "</b>" & " associated with your subscription to add a new Administrator. This will be sent to your school in a separate email."
strBody = strBody & "<br><br>"
strBody = strBody & "Should you require further assistance please phone 1234 5678 or email the team at ITAcademy@somewhere.com"
strBody = strBody & "<br><br>"
strBody = strBody & "Regards"
strBody = strBody & "<br><br><br><br>"
strBody = strBody & "Project Team"

'***creates and sends email
With objEmail
   
'Set body format to HTML
    .BodyFormat = olFormatHTML
   
    .SentOnBehalfOfName = "ITAcademy@somewhere.com"
    .To = strEmail
    .BCC = "joe@somewhere.com"
    .Subject = "Academy ID for " & Form__F_SendLogonDetails![Centre Name]
    .HTMLBody = strBody
    .Send
End With

Set objEmail = Nothing
Exit Sub
End Sub
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2013
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
President / Owner
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2017
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Scott McDaniel (EE MVE )Infotrakker Software
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
One more thing - you obviously have users who are sharing the SAME database, which is why that user's reference change affected everyone else. The suggested way to share an Access database is to "split" the database into a BackEnd (the Tables only) and a FrontEnd (everything else), then "link" the tables from the BE in the FE. Then, you make copies of the FE and distribute those to each user who needs to use the database.

Still, you should consider using Late Binding, as JimD suggests. If you do this, remember that you have to declare your Constants as well. the constant "olMailItem" will no longer be available if you remove the reference to the Outlook library, so you'll have to declare that in code:

Dim olMailItem As Integer
olMailItem = 0

Author

Commented:
Thank you both, this is much clearer now. I ended up declaring the objects as generic objects and everything is working as it should. I appreciate your responses.
if I install access run time .. Can i overcome this issue?

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.