Missing Reference MSOUTL.OLB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CD Tom
    Contributor
    • Feb 2009
    • 495

    Missing Reference MSOUTL.OLB

    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
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3665

    #2
    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!

    Comment

    • CD Tom
      Contributor
      • Feb 2009
      • 495

      #3
      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.

      Comment

      • twinnyfo
        Recognized Expert Moderator Specialist
        • Nov 2011
        • 3665

        #4
        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.

        Comment

        • Rabbit
          Recognized Expert MVP
          • Jan 2007
          • 12517

          #5
          There are more universal methods of sending email. For example, using a CDO object.

          Code:
          Sub sendEMail(strMessage)
          	On Error Resume Next
          	
          	Dim oCDO
          	Set oCDO = CreateObject("CDO.Message")
          	
          	With oCDO
          		.Subject = inputbox("subject")
          		.From = inputbox("from")
          		.To = inputbox("to")
          		
          		.HTMLBody = strMessage
          		.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
          		.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.emailserver.com"
          		.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
          		.Configuration.Fields.Update
          		.Send
          	End With
          	
          	If err.Number <> 0 Then err.Clear
          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.

          Comment

          • twinnyfo
            Recognized Expert Moderator Specialist
            • Nov 2011
            • 3665

            #6
            Rabbit,

            Very interesting. I never knew such a thing was available. Thanks for the tidbit!

            Comment

            • CD Tom
              Contributor
              • Feb 2009
              • 495

              #7
              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.

              Comment

              • CD Tom
                Contributor
                • Feb 2009
                • 495

                #8
                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?

                Comment

                • twinnyfo
                  Recognized Expert Moderator Specialist
                  • Nov 2011
                  • 3665

                  #9
                  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.

                  Comment

                  • CD Tom
                    Contributor
                    • Feb 2009
                    • 495

                    #10
                    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.

                    Comment

                    • Rabbit
                      Recognized Expert MVP
                      • Jan 2007
                      • 12517

                      #11
                      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.

                      Comment

                      • Rabbit
                        Recognized Expert MVP
                        • Jan 2007
                        • 12517

                        #12
                        Send using 2 tells it to use SMTP over the network.
                        Send using 1 tells it to use SMTP installed on the local computer.

                        Comment

                        • twinnyfo
                          Recognized Expert Moderator Specialist
                          • Nov 2011
                          • 3665

                          #13
                          Tom - now i'm beginning to see more of the complexities with this.

                          I know you can remove references in VBA (References.Rem ove), 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.

                          Comment

                          Working...