MadAlice22
New Member
- Joined
- Sep 12, 2019
- Messages
- 3
Good Morning, I am looking for some support with a template I am creating (see below). I have two controls - one to use to send the information in an email, and the other to clear the form. I have used a Macro for the clear form control, and that is working fine. I am looking for assistance with the VBA script for the send request control, as I am not confident with this!
<strike></strike>I would like it to do the following things if possible:
<strike></strike>I would like it to do the following things if possible:
- Take the data between B9 & K27 and paste it into the body of the email - I don't want to send the whole file as an attachment
- Only send the email if the fields F11, F13, F17, F19, F21, F23 & F25 have data in them, if not then display an error of some sort
This is the code I have so far for setting the email up:
On Error GoTo ErrHandler
' SET Outlook APPLICATION OBJECT.
Dim objOutlook As Object
Set objOutlook = CreateObject("Outlook.Application")
' CREATE EMAIL OBJECT.
Dim objEmail As Object
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
.To = "Danielle.short@cbre.com"
.CC = ""
.subject = "PO Request - CA001223-2 : Extra Works"
.body = "Please see attached new PO request"
.Display ' DISPLAY MESSAGE.
End With
' CLEAR.
Set objEmail = Nothing: Set objOutlook = Nothing
ErrHandler:
'
End Sub
Any help would be really appreciated!! I have seen a script for this before but can't for the life of me remember it!!
<strike></strike>
Thank you <strike></strike>