I would like an email to be sent to me when the user enters in a new record. We use Microsoft Outlook. How can I send an email? (Just need text, no file attached).
I would like an email to be sent to me when the user enters in a new record. We use Microsoft Outlook. How can I send an email? (Just need text, no file attached).
"The amount of stupid people in the world is God's way of punishing the smart people" - protean_being
[vba]
Dim OutlookApp As Object
Dim Mail as Object
Set OutlookApp = CreateObject("Outlook.Application")
Set Mail = OutlookApp.CreateItem(0)
With Mail
.To = recipient@something.com
.Subject = "Your subject"
.Body = "insert text here"
.Display
End With
[/vba]
This will display the message and the user will need to click send. You can use .Send in the With statement, but unfortunately it displays an alert which can't be suppressed by "DisplayAlerts = False".
there is a way around, but I think it's fairly complex...
Phil J.
if there is a way around it I would like to know. Please someone post if you know. Thanks!
"The amount of stupid people in the world is God's way of punishing the smart people" - protean_being
What about attachments?
"The amount of stupid people in the world is God's way of punishing the smart people" - protean_being