So far I have figured out how to send a file via a Macro that even forces Outlook to open if it isn't already open. However, It will not work with a webmail or anything other then Outlook Proper. So my question is, I would either like to elegantly check for webmail and make that open if Outlook is not found OR pop a window when it cant open outlook that says "send Manually" via MsgBox, but I wanted to toss this out in the Ether for some feedback.
Code:
Sub SendFile()
Dim OutApp As Object
Dim OutMail As Object
' Works in Excel 2000, Excel 2002, Excel 2003, Excel 2007, Excel 2010,
' Outlook 2000, Outlook 2002, Outlook 2003, Outlook 2007, Outlook 2010.
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
' Change the mail address and subject in the macro before you run it.
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Master List Corrections"
.Body = "Attached, please find the most current, edited copy of the Master List."
.Attachments.Add ActiveWorkbook.FullName
' You can add other files by uncommenting the following line.
'.Attachments.Add ("C:\test.txt")
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Bookmarks