💡 Source Code
Sub SendToOutlookLB() 'LATE BINDING
Dim oApp As Object, oMail As Object
With Application
.ScreenUpdating = 0
Set oApp = CreateObject("Outlook.Application")
Set oMail = oApp.CreateItem(olMailItem)
oApp.Session.Logon
With oMail
.To = "[email protected]"
.CC = ""
.BCC = ""
.Subject = "Late Binding"
.Body = "Hello World"
.Send
End With
Set oMail = Nothing
Set oApp = Nothing
.ScreenUpdating = -1
End With
MsgBox "The mail was sent successfully", vbInformation + vbOKOnly, ""
End Sub
Sub SendToOutlookEB() 'EARLY BINDING Activate Microsoft Outlook 16.0 Object Library
Dim oApp As New Outlook.Application, oMail As Object
With Application
.ScreenUpdating = 0
Set oMail = oApp.CreateItem(olMailItem)
oApp.Session.Logon
With oMail
.To = "[email protected]"
.CC = ""
.BCC = ""
.Subject = "Early Binding"
.Body = "Hello World"
.Send
End With
Set oMail = Nothing
Set oApp = Nothing
.ScreenUpdating = -1
End With
MsgBox "The mail was sent successfully", vbInformation + vbOKOnly, ""
End Sub
------------------------------------------------------------------------------------------
#excel
#msexcel
#msexceltutorial
#msexcelcourse
#vba
#vbatutorial
#excelvba
#fulltutorial
#excelvbatutorial
#microsoftexceltutorial
#tutorial
#exceltutorial
#advancedexcel
#advancedexceltraining
#algorithm
#algorithms
#programming
#program
#script
#vbamacro
#vbamacros
#usingmacro
#veryuseful
#useful
#veryusefulmacro
#freeeducation
#freeprogramming
#freelancer
#excelfreelancer
#vbafreelancer
#freelanceservices
#excelvbasendmail
#mail
#outlook
#sendemailfromexcel
#sendemailthroughoutlook
#earlybinding
#latebinding
#earlybindinginvba
#latebindinginvba