Falloff
New Member
- Joined
- Feb 22, 2023
- Messages
- 2
- Office Version
- 2016
- Platform
- Windows
Hi everyone,
since this is the first time, that I have not found the solution to an issue here in the forum, I thought I'd go ahead and finally post a question myself.
(so first off - thanks for all the previous help)
I am trying to come up with some VBA code that basically does the following:
A colleague marks interesting reports or files with an "X" in column F and, when clicking "Request", automatically sends me an e-mail with the values from column A. The mail basically would look something like this:
"Hello, please send the following:
- Report A
- Report C
- File 12
Thanks."
'Big' question now is, how can I display this text correctly? The code to generate and send the mail seems to be working fine, so we are only talking about the actual text.
What I have so far is this:
If anyone can help, thanks in advance!
since this is the first time, that I have not found the solution to an issue here in the forum, I thought I'd go ahead and finally post a question myself.
(so first off - thanks for all the previous help)
I am trying to come up with some VBA code that basically does the following:
A colleague marks interesting reports or files with an "X" in column F and, when clicking "Request", automatically sends me an e-mail with the values from column A. The mail basically would look something like this:
"Hello, please send the following:
- Report A
- Report C
- File 12
Thanks."
'Big' question now is, how can I display this text correctly? The code to generate and send the mail seems to be working fine, so we are only talking about the actual text.
What I have so far is this:
VBA Code:
Set MailDoc = Maildb.CreateDocument
MailDoc.Form = "Memo"
Recipient = "mail@xyz.com"
MailDoc.SendTo = Recipient
lastRow = Cells(Rows.Count, "F").End(xlUp).Row
If InStr(1, Range("F3:F", lastRow), "X") Then
MailDoc.Subject = "Pending Request"
MailDoc.Body = _
"Please send me the following:" & vbCrLf & vbCrLf & Range("F3:F", lastRow).Offset(0, -5).Value
Else
End If
MailDoc.SaveMessageOnSend = True
MailDoc.PostedDate = Now()
On Error GoTo errorhandler1
MailDoc.Send 0, Recipient
End Sub
If anyone can help, thanks in advance!