I have a code for sending a email message from excel with microsoft outlook. I would like to use the code also for outlook express but I do not know how to set the reference to outlook express 5. Can anyone help me?
Thank you very much.
Below you have the code for microsoft outlook.
Filotei
Thank you very much.
Below you have the code for microsoft outlook.
Filotei
Code:
Sub Send_Message()
Dim objOL As New Outlook.Application ' this is for Microsoft Outlook
'what will be the reference for Outlook Express 5?
Dim objMail As MailItem
Set objOL = New Outlook.Application ' for outlook express 5?
Set objMail = objOL.CreateItem(olMailItem)
With objMail
.To = Address
.subject = Sbj
.Body = BodyText
.Send
End With
Set objMail = Nothing
Set objOL = Nothing
End Sub