Author : Elton House
Date Submitted : 5/24/2006
Category : Internet
Compatibility : VB 6
This code has been accessed 9238 times.
Task : Send email with Microsoft Office Outlook 2000 - 2003 without the Warning
A program is trying to send mail. Includes attachment coding.
Declarations
Code
Dim strPath$, OutlookItem, ColAttach
Const olByValue = 1
Set OutlookItem = Application.CreateItem(0)
OutlookItem.To = "youremail@email.com"
OutlookItem.Subject = "This will work!"
OutlookItem.Body = "This works great, no warning message from Outlook!"
Set ColAttach = OutlookItem.Attachments
strPath = App.Path & "\simple.txt"
ColAttach.Add strPath, olByValue, 1, "File Attachment"
OutlookItem.Display
SendKeys "%{s}", True