Hi Guru's
I am creating a stock taking database and need the automatic email to send the value in a specific cell in this case lets say M6.
I need the value of cell M6 to replace the text below where it reads "3 units or below" so it shows the exact remaining stock level.
Thanks in advance for all your help!
I am creating a stock taking database and need the automatic email to send the value in a specific cell in this case lets say M6.
I need the value of cell M6 to replace the text below where it reads "3 units or below" so it shows the exact remaining stock level.
Thanks in advance for all your help!
VBA Code:
Sub Mail_small_Text_Outlook(sName As String)
Dim xOutApp As Object
Dim xOutMail As Object
Dim xMailBody As String
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "Hi Laura" & vbNewLine & vbNewLine & _
[U][B] "The current stock of '" & sName & "' is at 3 units or below. New stock should be ordered." & vbNewLine & _[/B][/U]
"Kind Regards" & vbNewLine & vbNewLine & _
"Stock Keeper"
With xOutMail
.To = "jon@test.co.uk"
.CC = ""
.BCC = ""
.Subject = "Low Stock Alert - " & sName
.Body = xMailBody
.Display 'or use .Send
End With
Set xOutMail = Nothing
Set xOutApp = Nothing
End Sub