' 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 If End Sub
'VBA2 SendObject example (Error: The Command or action 'SendObject' isn't available now.) Dim stDocName As String stDocName = "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. "
Gain unlimited access to on-demand training courses with an Experts Exchange subscription.Get Access
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.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE
Connect with Certified Experts to gain insight and support on specific technology challenges including: