Hi. I've been bringing along an old, shared access database that was designed in Access 2000. There are email send object and OLMail commands sprinkled throughout this thing. Quite a few years back we moved to office (& Outlook) 2010 and I was able to keep it and all of the email functions working. Recently, we are starting to move to Office 365 and are in sort of a hybrid state right now.. I have users running Office 2010 (w/Access 2010) and Outlook 2010, other users running office 2010 (& Access 2010) and Outlook 365 and a very few running the full Office 365 suite. Besides that, I have users on both Windows 7 and on Windows 10. Luckily, for now; the handful on the full office 365 suite don't use Access but I imagine we'll be moving more users soon. I expect we'll be slowly moving users to full office 365 over the next couple years due to the number of users and lack of $$ available for this project.
My problem is in sending mail from within Access. Everything else works fine. My office and outlook 2010 users don't have an issue as long as the correct outlook object reference is available. I think my issue is with the users who are using outlook 365. The send object and OLMail objects don't work. If I look at the references on various clients, I do see the correct MS Outlook Object Library reference for 14 or 16 based on the outlook client installed on that machine. I've included my reference lists and a couple email send code examples being used. What is my best course of action at this point? I'm trying to steer away from a full redesign if possible.. thanks Access-VBA-Reference-List.docx
' VBA1 OLMailItem Send Mail (Error: Run Time Error 5: Invalid procedure call or argument)Private Sub RGReason_LostFocus()If RGReason = "Lost in Shipment" Then 'Dim Outlook Set Outlook = CreateObject("Outlook.Application") Dim Message 'As Outlook.MailItem Set Message = Outlook.CreateItem(olMailItem) With Message .Subject = "RG #" & [RGNo] & " created for items lost in shipment." .Body = "Gina, please send a copy of Invoice #" & [InvNo] & " to Shawn for Lost Goods. Thank you." .recipients.Add ("firstname.lastname@example.org") .recipients.Add ("email@example.com") .Send End With MsgBox "Notice of Lost Goods has been issued to UserA and UserB to follow up with the carrier in recovering these goods.", , "Note"End IfEnd Sub
'VBA2 SendObject example (Error: The Command or action 'SendObject' isn't available now.) Dim stDocName As StringstDocName = "CreditMockUp3"DoCmd.SendObject acReport, stDocName, acFormatPDF, "firstname.lastname@example.org", , , "Issue Credit for RG No. " & [RGNo], "Credit mock-up attached. See RG# " & [RGNo] & " for more details. "
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
-Mike Kapnisakis, Warner Bros
With your subscription - you'll gain access to our exclusive IT community of thousands of IT pros. You'll also be able to connect with highly specified Experts to get personalized solutions to your troubleshooting & research questions. It’s like crowd-sourced consulting.
We can't always guarantee that the perfect solution to your specific problem will be waiting for you. If you ask your own question - our Certified Experts will team up with you to help you get the answers you need.
Our certified Experts are CTOs, CISOs, and Technical Architects who answer questions, write articles, and produce videos on Experts Exchange. 99% of them have full time tech jobs - they volunteer their time to help other people in the technology industry learn and succeed.
We can't guarantee quick solutions - Experts Exchange isn't a help desk. We're a community of IT professionals committed to sharing knowledge. Our experts volunteer their time to help other people in the technology industry learn and succeed.