By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,089 Members | 2,226 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,089 IT Pros & Developers. It's quick & easy.

Missing Reference MSOUTL.OLB

100+
P: 443
This has just started on some of my customers computers. I call outlook from within my app to send out emails. My program is on customers computers is compiled .accdr, I getting calls from some of my customers that they are getting an error "function not available". When I do the check references I find that the Outlook object library OLB is missing and that is causing the problem. What I've found is that if the customer doesn't have outlook on his/her machine that this is happening. I don't know why this hasn't happened before but now it has started. If I remove the MSOUTL.OLB reference everything works fine, but of course for those that have Outlook then Outlook doesn't work.
I don't want to have two programs one for Outlook and another for those without Outlook.
Does any body have any answers???
Thanks
Mar 11 '19 #1
Share this Question
Share on Google+
12 Replies


twinnyfo
Expert Mod 2.5K+
P: 3,284
Hey Tom!

My first question would be why all users in an enterprise environment don't have the same software--but that's probably way out of your hands.

My second question would then be, if they don't use Outlook, what do they use for e-mails? If you have a plethora of e-mail options, then you r job becomes increasingly more difficult, if not impossible.

If there is only one other e-mail option, then you need to figure out how to integrate that application into Access--in a manner similar to how you integrate Outlook. You would then just need to figure out who uses which e-mail system, which can become a nightmare.

The "best" solution is to have ll users on one e-mail system.

Hope this hepps!
Mar 11 '19 #2

100+
P: 443
OK, some of my customers don't use the program to send emails. The program has options to send out reports created in PDF right from within the program.
Some customers use another email and create and save the pdf and then using their email provider (yahoo, gmail, etc) send the reports out that way.
I wish I knew how to setup VBA to use other email providers, and be able to check each user to find out which email provider they used and switch the program to use their provider.
Anyway thanks for the reply.
Mar 11 '19 #3

twinnyfo
Expert Mod 2.5K+
P: 3,284
You may have to set up error trapping within your code. Theoretical example here:
  • Someone wants to send a pdf from the Db
  • The DB asks if they use Outlook
  • If they say no, it just downloads the PDF and tell sthem to send it manually
  • If they say yes, the DB tries to send it
  • If an error is produced, it notifies the user and downloads the PDF
  • If there is no error, it sends the pdf via outlook

This might be a bit more involved than what you were thinking, but it might be a bit less involved than trying to build around other e-mail applications.
Mar 11 '19 #4

Rabbit
Expert Mod 10K+
P: 12,366
There are more universal methods of sending email. For example, using a CDO object.

Expand|Select|Wrap|Line Numbers
  1. Sub sendEMail(strMessage)
  2.     On Error Resume Next
  3.  
  4.     Dim oCDO
  5.     Set oCDO = CreateObject("CDO.Message")
  6.  
  7.     With oCDO
  8.         .Subject = inputbox("subject")
  9.         .From = inputbox("from")
  10.         .To = inputbox("to")
  11.  
  12.         .HTMLBody = strMessage
  13.         .Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
  14.         .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.emailserver.com"
  15.         .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
  16.         .Configuration.Fields.Update
  17.         .Send
  18.     End With
  19.  
  20.     If err.Number <> 0 Then err.Clear
  21. End Sub
You will just need to figure out the correct server address and port. For outlook, you can find that in your in account settings or you can ask your exchange server admin. For gmail and yahoo, you can find that online. For the latter, you will need to modify the script to pass in credentials.
Mar 11 '19 #5

twinnyfo
Expert Mod 2.5K+
P: 3,284
Rabbit,

Very interesting. I never knew such a thing was available. Thanks for the tidbit!
Mar 11 '19 #6

100+
P: 443
That would probably work except. In the references the MSOUTL.OLB is checked if the user uses Outlook, however if they don't have outlook then they get a reference error and the "function not available" shows up. Is there a way to remove the MSOUTL.OLB reference from the references if the user doesn't have outlook installed on their computer.
Mar 11 '19 #7

100+
P: 443
I like the idea Rabbit, in your example how would you attach a document to this from and could you send to multiple users. I suppose you could just create a loop.
Might give this a test.
What is the 2 for in the sendusing?
Mar 11 '19 #8

twinnyfo
Expert Mod 2.5K+
P: 3,284
Tom,

Concerning your Post #7, that's what I was talking about error trapping. If someone tries to send something and they get this error, you need to find out the error number and if the DB encounters that error, go to Plan B.
Mar 11 '19 #9

100+
P: 443
I can trap that error number but going to Plan B means I still would have to eliminate the MSOUTL.OLB reference otherwise the "function not available" would not function. So is there a way in VBA to remove a reference, remember this is a .accdr and I only have the VBA code to try and remove the MSOUTL.OLB reference.
Mar 11 '19 #10

Rabbit
Expert Mod 10K+
P: 12,366
The CDO object has an AddAttachment method. You just need to supply the path of the file you want to attach.

You can use a loop. You can also supply multiple email addresses for the To property. If you're sending a mass email, a BCC might be better so you don't get reply all spam.

What you see above is pretty much the bare minimum to send an email through an exchange server.
Mar 11 '19 #11

Rabbit
Expert Mod 10K+
P: 12,366
Send using 2 tells it to use SMTP over the network.
Send using 1 tells it to use SMTP installed on the local computer.
Mar 11 '19 #12

twinnyfo
Expert Mod 2.5K+
P: 3,284
Tom - now i'm beginning to see more of the complexities with this.

I know you can remove references in VBA (References.Remove), but I'm not sure if the user who didn't have Outlook would hit that error first. But, it might be worth a try to remove that reference whenever the DB encounters the said error number.
Mar 11 '19 #13

Post your reply

Sign in to post your reply or Sign up for a free account.