I have an existing module that creates an outlook mail message. This works great except I can’t specify “from” in my code. I realize .from isn’t supported,
What method should I use instead of “with mailoutlook”? Below is my existing code:
What method should I use instead of “with mailoutlook”? Below is my existing code:
Code:
Private Sub SendMailPro_Click()
Set appoutlook = CreateObject("outlook.application")
Set mailoutlook = appoutlook.CreateItem(olMailItem)
Dim stringBody_ext As String
If Me.[SS_TorP] = "P" Then
stringBody_ext = "migration. I'll inform you of the reults on the next business day."
Else
stringBody_ext = "migration to SLTEST. I'll inform you of the reults on the next business day."
End If
With mailoutlook
.To = Me.[SS_Sent_By]
.Subject = "'" & Me.[SS_Excel_Name] & "' was processed successfully"
.Body = "The spreadsheet '" & Me.[SS_Excel_Name] & _
"' was processed and will be included in tonight's data " & stringBody_ext
.Display
End With
End Sub