Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub SendMail(mailSubject As String, mailBody As String, mailTo As String, mailAttach as String)
Dim ol As New Outlook.Application
Dim olns As Outlook.NameSpace
Dim olmail As Outlook.MailItem
Set ol = CreateObject("Outlook.Application")
Set olmail = ol.CreateItem(olMailItem)
With olmail
.To = mailTo
.Subject = mailSubject
.Body = mailBody
.Attachment = mailAttach
.Send
End With
Set ol = Nothing
End Sub
OK, I found out that errors in second and third line were because:
Microsoft Outlook xx.x Object Library in tools > references menu was missing.
; AND ETID wrote;Is the Type library referenced?
'You will need to add the "Microsoft Outlook xx.x Object Library via the tools > references menu in the vba editor....