Hello folks,
I am hoping someone might be able to help out with some VBA code.
I have the following code, which works fine for the first row. After it has completed that row I want it to move to next row until the cells are blank.
I think I need to set the range as an integer, but I am not sure if that is right or how to do that. Appreciate any help! TIA
Jacki
Sub Mail_send_Mail_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "email@address"
.Subject = Sheet1.Range("G6")
.Body = "#DO NOT MODIFY FOLLOWING TEXT#" & vbCrLf & "Action:Modify" & vbCrLf & "Server:appdc1" & vbCrLf & "Schema:AP:Signature" & vbCrLf & "Request ID:" & Range("H6") & vbCrLf & "Approval Status!" & vbCrLf & vbCrLf & "Status Template:Approval_By_Email_Status_en" & vbCrLf & "Result Template:Approval_By_Email_Result_Approve_en" & vbCrLf & Range("I6")
.Send
Range("A5:D5000").Select
Selection.ClearContents
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
I am hoping someone might be able to help out with some VBA code.
I have the following code, which works fine for the first row. After it has completed that row I want it to move to next row until the cells are blank.
I think I need to set the range as an integer, but I am not sure if that is right or how to do that. Appreciate any help! TIA
Jacki
Sub Mail_send_Mail_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "email@address"
.Subject = Sheet1.Range("G6")
.Body = "#DO NOT MODIFY FOLLOWING TEXT#" & vbCrLf & "Action:Modify" & vbCrLf & "Server:appdc1" & vbCrLf & "Schema:AP:Signature" & vbCrLf & "Request ID:" & Range("H6") & vbCrLf & "Approval Status!" & vbCrLf & vbCrLf & "Status Template:Approval_By_Email_Status_en" & vbCrLf & "Result Template:Approval_By_Email_Result_Approve_en" & vbCrLf & Range("I6")
.Send
Range("A5:D5000").Select
Selection.ClearContents
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub