desmondwkng
asked on
Excel VBA - Email
How Can I write a VBA and email the current file to different people and hard some of the message, and some variables (including the topic) with message box
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The same thing from a different application is as follows:
Chris
Note replacing .display with .send will simply send the email ... if that is required in the application.
Sub sendamail()
Dim str As String
Dim olkApp As Object
str = InputBox("Identify any extra recipients", "Recipient Entry")
Set olkApp = CreateObject("outlook.application")
With olkApp.CreateItem(0)
.Subject = "My Subject"
.Body = "Mail Body" & vbCrLf & vbCrLf & "And it all starts here"
.To = "fred@fred.com, doris@doris.com"
If str <> "" Then .To = .To & "," & str
.Display
End With
End Sub
Chris
Note replacing .display with .send will simply send the email ... if that is required in the application.
He's got all the Outlook code examples you'll ever need.
HTH,