Hello all,
I know I found a method to send a plain text message yesterday but cannot find it again. I am currently using the SendObject method but that still gives me a prompt to send it. The below code holds some promise, but it still shows the email message and then sends it. I know that I found a send email method where it was just plain text and did not prompt me for anything, it just sent. That is what I am look for. *Should have saved it when I had it*. lol
Code:
Dim olApp As outlook.Application
Dim objNS As Outlook.Namespace
Dim objMail As Outlook.MailItem
Dim objSentItems As Outlook.MAPIFolder
Dim myInspector As Outlook.Inspector
'Check whether outlook is open, if it is use get object, if not use create object
On Error Resume Next
Set olApp = GetObject(, "Outlook.Application")
On Error GoTo 0
If olApp Is Nothing Then
Set olApp = CreateObject("Outlook.Application")
End If
Set objNS = olApp.GetNamespace("MAPI")
objNS.Logon
'Prepare the mail object
Set objMail = olApp.CreateItem(olMailItem)
With objMail
.To = <insert recipients name as string>
.Subject = <insert subject as string>
.Body = <insert message as string>
.Display
End With
'Give outlook some time to display the message
Application.Wait (Now + TimeValue("0:00:05"))
'Get a reference the inspector obj (the window the mail item is displayed in)
Set myInspector = objMail.GetInspector
'Activate the window that the mail item is in and use sendkeys to send the message
myInspector.Activate
SendKeys "%s", True