I have this code to send an excel attachment via Outlook. The workbook itself has data coming in from Access. How would I modify the send mail code attachment to kill the connection strings when attaching it to email? I want to avoid the recipient going through the messages that's it looking for the connection. Here is the code.....
Dim OutApp As Object
Dim OutMail As Object
Dim sTO As String, sSubj As String
Dim filePath As String
Application.ScreenUpdating = False
Application.DisplayAlerts = False
filePath = ActiveWorkbook.Path & "\RFQ - " & [M6] & ".xlsx"
ActiveWorkbook.SaveAs filePath, 51
sTO = [E26]
sSubj = [M5]
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
.To = sTO
.CC = ""
.BCC = ""
.Subject = sSubj & Range("M6")
.Body = "Hi, " & Range("E23") & vbNewLine & vbNewLine & _
"Would you please quote per the attached RFQ " & Range("M6") & vbNewLine & vbNewLine & _
"Please note that thIs RFQ IS competitive and time sensitive. Cost and schedule are both important parameters for these RFQ responses" & vbNewLine & vbNewLine & _
"Please complete the RFQ per the BID Closing Date " & Range("N11") & ". On the RFQ please include the delivery date and Lead times." & vbNewLine & vbNewLine & _
"Note this is a DX rated program.Should you have any questions about the RFQ, please feel free to contact me"
.Display 'or use .Send
If Len(Dir(filePath)) > 0 Then
SetAttr filePath, vbNormal
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
Application.ScreenUpdating = True