Microsift VBA Early vs. Late Binding Example
Private Sub Early_vs_Late_Binding_Example()
#Const LATEBINDING = False
#If LATEBINDING Then
Dim objOutlook As Object
Set objOutlook = CreateObject("Outlook.Application")
#Else
' NOTE! Early binding requires a typelib reference. In the VBE click Tools -> References
' and make sure that "Microsoft Outlook xx.x Object Library" is selected
Dim objOutlook As Outlook.Application
Set objOutlook = New Outlook.Application
#End If
Set objOutlook = Nothing
End Sub