I have the following code, the only thing it is not doing is timing out. What am I
missing? Thanks in advance.
Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
Dim intButton : intButton = WshShell.Popup ("Do you wish EMail to be sent?", 5, "Send
Email?", 1 + 32)
Select Case intButton
Case 2
Case Else
Dim myAttachments, olMailItem, AppActivate
Dim objOutlook : Set objOutlook = CreateObject("Outlook.Application")
Dim itmMail : Set itmMail = objOutlook.CreateItem(olMailItem)
With itmMail
'Display is optional
.Display
.To = strTo
.Subject = strSubject
.Body = strTextBody
End With
'-- It's advised to save items before sending
itmMail.Save
'adding attachments.
If not strAttachment = "" Then
Set myAttachments = itmMail.Attachments
myAttachments.Add strAttachment
End If
'Instead of itmMail.Send, use the SendKeys feature.
WshShell.AppActivate itmMail
'"%S" = "Ctrl S"
WshShell.SendKeys("%s")
End Select