ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   email question (https://www.excelbanter.com/excel-programming/305102-email-question.html)

tiptop[_6_]

email question
 
Hello all,

I have a question and need some help. I am using the below vba t
email a document. What I need to do, is instead of emailing th
document as the original name, I need it to email it with the name o
"Exception Request for [Name], Aspect: [Date1]" I am trying to avoi
having the file rewrite itself everytime it sends the document. Thank
for any help provided.



Sub Mail_workbook_1()

Dim RecipArrayA As Variant
Dim RecipArrayB As Variant
RecipArrayA = "
'Sheets("Specialist").Range("AL11:AL14")
RecipArrayB = Sheets("Specialist").Range("AL11:AL14")
Dim Style As Variant, Title As Variant, Msg As Variant, Response A
Variant
Dim Name As Variant
Dim date1 As Variant
Dim Time As Variant
'date1 = Now(long)
[Name] = Sheets("Specialist").Range("S11")
[Time] = Sheets("Specialist").Range("AW11")

If Range("s11") = "" Then
MsgBox "Please enter your Name"
Exit Sub
End If
If Range("AL11") = "" Then
MsgBox "Please enter your network ID (Windows Login)"
Exit Sub
End If
If Range("AW11") = "" Then
MsgBox "Please enter your Aspect Number"
Exit Sub
End If
If Range("T15") = "Select Team Lead/Manager" Then
MsgBox "Please select your Team Lead/Manager from the drop-dow
menu"
Exit Sub
End If
If Range("AX14") = "" Then
MsgBox "Please enter the date that this exception is pertainin
to"
Exit Sub
End If
If Range("I23") = "Exception Type" Then
MsgBox "Please enter the exception type"
Exit Sub
End If
If Range("P22") = "" Then
MsgBox "Please enter the exception start time"
Exit Sub
End If
If Range("V22") = "" Then
MsgBox "Please enter the exception end time"
Exit Sub
End If
Worksheets("WFM").Select
ActiveWorkbook.SendMail Recipients:=RecipArrayA, Subject:="WF
Exception Request for " & [Name] & ", Aspect: " & [Time]
Style = vbOKOnly
Title = "WFM Exception Request System"
Msg = "Your request has been sent to WFM/The Bridge. A copy of you
request can be found in the 'Sent Items' folder of Outlook."
Response = MsgBox(Msg, Style, Title)
ActiveWorkbook.Close savechanges:=False
ActiveWorkbook.Close savechanges:=False
End Su

--
Message posted from http://www.ExcelForum.com


tiptop[_7_]

email question
 
actually, nevermind. I figured it out. Thanks tho!


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 04:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com