Dear Vignesh,

Please try it.

Sub send_range_as_table()
'''''''''''''''''' tools -> refrence -> Microsoft outlook
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim mailbody As String

       mailbody = "<TABLE Border=""1"", Cellspacing=""0""><TR>" & _
       "<TD Bgcolor=""#2B1B17"", Align=""Center""><Font Color=#FCDFFF><b><p
style=""font-size:18px"">Rep Name&nbsp;</p></Font></TD>" & _
       "<TD Bgcolor=""#2B1B17"", Align=""Center""><Font Color=#FCDFFF><b><p
style=""font-size:18px"">Zone&nbsp;</p></Font></TD>" & _
       "<TD Bgcolor=""#2B1B17"", Align=""Center""><Font Color=#FCDFFF><b><p
style=""font-size:18px"">Location&nbsp;</p></Font></TD>" & _
       "<TD Bgcolor=""#2B1B17"", Align=""Center""><Font Color=#FCDFFF><b><p
style=""font-size:18px"">Sales&nbsp;</p></Font></TD>" & _
          "</TR>"

       For i = 2 To Sheets(1).Range("a1048576").End(xlUp).Row

                  mailbody = mailbody & "<TR>" & _
                   "<TD ><center>" & Sheets(1).Range("a" & i).Value &
"</TD>" & _
                   "<TD><center>" & Sheets(1).Range("b" & i).Value &
"</TD>" & _
                   "<TD><center>" & Sheets(1).Range("c" & i).Value &
"</TD>" & _
                   "<TD><center>" & Sheets(1).Range("d" & i).Value &
"</TD>" & _
                        "</TR>"

            Next i

' <br> used to insert a line ( press enter)
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = "noorain.ans...@gmail.com"
.CC = ""
.Subject = "Send Range in the body of outlook email as Formatted Table"
.HTMLBody = "Please find the ----- below ----- <br><br> " & mailbody &
"</Table><br> <br>Regards <br> <br> Noorain Ansari"
.Display
'.Send
End With

End Sub




-- 
With Regards,
Noorain Ansari
http:// 
<http://www.noorainansari.com>noorainansari.com<http://www.noorainansari.com>
http:// 
<http://www.excelvbaclinic.blogspot.com>excelvbaclinic.com<http://www.excelvbaclinic.blogspot.com>
On Sun, Oct 7, 2012 at 6:35 PM, Vignesh S R <srvigneshs...@gmail.com> wrote:

> Hi all,
>
> I am trying to send mail from Excel sheet.i have copied the contents
> from the excell sheet but i cant able to get the values in Tables in
> my mail.
> its just copyingthe values as paragaraph and not like tables(eg 3 x 3
> tables values).
> Kindly do the needful.
>
> --
> Vignesh .S.R
>
> --
> Join official facebook page of this forum @
> https://www.facebook.com/discussexcel
>
> FORUM RULES (1120+ members already BANNED for violation)
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
>
> 2) Don't post a question in the thread of another member.
>
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
>
> 4) Acknowledge the responses you receive, good or bad.
>
> 5)  Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.
>
> 6) Jobs posting is not allowed.
>
> 7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed.
>
> NOTE  : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
> ---
> You received this message because you are subscribed to the Google Groups
> "MS EXCEL AND VBA MACROS" group.
> To post to this group, send email to excel-macros@googlegroups.com.
> To unsubscribe from this group, send email to
> excel-macros+unsubscr...@googlegroups.com.
>
>
>

-- 
Join official facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES (1120+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

6) Jobs posting is not allowed.

7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed.

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To post to this group, send email to excel-macros@googlegroups.com.
To unsubscribe from this group, send email to 
excel-macros+unsubscr...@googlegroups.com.


Attachment: Email formatted table.xlsm
Description: Binary data

Reply via email to