cvincent
Board Regular
- Joined
- Aug 28, 2011
- Messages
- 66
I am having trouble with this macro. The file is a form the user completes (v1), then clicks the macro to submit (v2). In doing so, a new version is created. The user goes back to his form, and has a button he can clear the form and submit a new request. But now the form is actually named (v2) instead of the actual original form name. Can you please advise? Thank you.
Sub Send()
' Send Macro
ActiveWorkbook.Save
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
' Change the mail address and subject in the macro before you run it.
With OutMail
.To = "email address"
.CC = ""
.BCC = ""
.Subject = "Request Form"
.Body = "Please process the attached Request Form." & Chr(10) & Chr(10)
.Attachments.Add ActiveWorkbook.FullName
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Sub Send()
' Send Macro
ActiveWorkbook.Save
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
' Change the mail address and subject in the macro before you run it.
With OutMail
.To = "email address"
.CC = ""
.BCC = ""
.Subject = "Request Form"
.Body = "Please process the attached Request Form." & Chr(10) & Chr(10)
.Attachments.Add ActiveWorkbook.FullName
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub