So I am using the following email macro listed below.
I need two macros
one for a report that will attach the report and copy a range (A1:L130) into the body of the email
the second one is for a fax sent via email the fax number will always change
the fax number is always entered in the same cell C7 what doesn't change is is the domain
I need the fax email to do the same as the macro email copy a range and paste into the body of the email
look at C7 copy the fax number and add the domain name sample 4071234567@google.com
Sub CommandButton1_Click()
Dim xOutlookobj As Object
Dim xOutapp As Object
Dim xOutmail As Object
Dim xMailbody As String
On Error Resume Next
Set xOutapp = CreateObject("Outlook.Application")
Set xOutmail = xOutapp.CreateItem(0)
xMailbody = "TEST01 " & vbNewLine & vbNewLine & ""
On Error Resume Next
With xOutmail
.To = "TEST@TESTER.COM"
.CC = ""
.BCC = ""
.Subject = "SECURED MESSAGE"
.Body = xMailbody
.Attachments.Add ActiveWorkbook.FullName
.Display
End With
On Error GoTo 0
Set xOutmail = Nothing
Set xOutapp = Nothing
End Sub
any help will be deeply appreciated
I need two macros
one for a report that will attach the report and copy a range (A1:L130) into the body of the email
the second one is for a fax sent via email the fax number will always change
the fax number is always entered in the same cell C7 what doesn't change is is the domain
I need the fax email to do the same as the macro email copy a range and paste into the body of the email
look at C7 copy the fax number and add the domain name sample 4071234567@google.com
Sub CommandButton1_Click()
Dim xOutlookobj As Object
Dim xOutapp As Object
Dim xOutmail As Object
Dim xMailbody As String
On Error Resume Next
Set xOutapp = CreateObject("Outlook.Application")
Set xOutmail = xOutapp.CreateItem(0)
xMailbody = "TEST01 " & vbNewLine & vbNewLine & ""
On Error Resume Next
With xOutmail
.To = "TEST@TESTER.COM"
.CC = ""
.BCC = ""
.Subject = "SECURED MESSAGE"
.Body = xMailbody
.Attachments.Add ActiveWorkbook.FullName
.Display
End With
On Error GoTo 0
Set xOutmail = Nothing
Set xOutapp = Nothing
End Sub
any help will be deeply appreciated