pls have a luk on below code
above code is working fine, but in mail body table is not appearing properly.
that is last row of the table is not having line in it... i couldn't resolve it even after many try... pls
me
Rich (BB code):
Private Sub CommandButton1_Click()
Dim OutApp As Object
Dim OutMail As Object
Dim rng As Range
Dim str As String, str1 As String
Dim in1 As String, in2 As String
in1 = InputBox("Range1:")
in2 = InputBox("Range2:")
Set rng = Sheets("sheet1").Range(in1 & ":" & in2).SpecialCells(xlCellTypeVisible)
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
strbody = ActiveSheet.Range(in1 & ":" & in2).Select
str = "<font face='Trebuchet MS' size=2 color=blue >" & "Hi All," & "<br><br>" & "Good Morning !!!" & "<br><br>" & "Please find today's allocation below:" & "<br><br>" & "</font>"
str1 = "<font face='Trebuchet MS' size=2 color=blue >" & "Thanks," & "<br>" & "GopDeep" & "</font>"
On Error Resume Next
With OutMail
.To = "gopdeep@aaa.com"
.CC = "gopdeep1@aaa.com"
.BCC = ""
.Subject = "Sample" & Chr(32) & Range("H4") & " Mail it is"
.HTMLBody = str & RangetoHTML(rng) & "<br><br>" & str1
.Display
.ReadReceiptRequested = True
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
above code is working fine, but in mail body table is not appearing properly.
that is last row of the table is not having line in it... i couldn't resolve it even after many try... pls
