Sending email using late binding
Could someone please correct this for sending email using late binding (using the structure as I have, as far as possible)? I am back to VB6 after an absence. This is what I have constructed from memory
Code:
Last edited by el84; Today at 05:45 AM.
Could someone please correct this for sending email using late binding (using the structure as I have, as far as possible)? I am back to VB6 after an absence. This is what I have constructed from memory
Code:
Code:
'Email1 Send email using late binding
Const outlookReplace = 1 'why?
Option Explicit
Dim objApp As Object ' * 'Object' is for late binding
Dim objEmail As Object
Dim Message As String
Private Sub Form_Load() ' * needed?
End Sub
Private Sub cmdGo_Click()
Message = txtMessage.Text
Set objApp = CreateObject("outlook.application")
With objEmail
.To = "(myown email address)"
.Subject = "Testing automatic send at " & Time
.body = Message
.send
End With
End Sub
Private Sub cmdExit_Click()
Set objEmail = Nothing
Set objApp = Nothing
Unload Me
End Sub