Puting Table in Outlook Mailitem

L

lucotuslim

Hi, appreciate if cud provide code for putting Table in outlook Mailitem.
I managed to create the new mail item via

Dim moutlook As Outlook.Application
Set moutlook = New Outlook.Application

Dim moutitem As Outlook.MailItem
Set moutitem = moutlook.CreateItemFromTemplate(S)
moutitem.display

But I need insert table base on recordset I queried from Access database
(recordset).
 
S

Sue Mosher [MVP-Outlook]

You still didn't say what version of Outlook.

Your best strategy for creating a table would be to build it as an HTML table with <table>, <tr>, and <td> tags. Each database record would be a row, and each cell a field from that record. Once you have the HTML content for the item built as a string, set the item's HTMLBody property to that string.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



lucotuslim said:
I used CreateItemFromTemplate(S) with S referring to an Outlook Item.
 
L

lucotuslim

I am writing the code for MS OUTLOOK 2003 and I intended to copy the code to
other PC that might using 2000, 97...
 
S

Sue Mosher [MVP-Outlook]

Outlook 97 does not support HTML. You'd have to use RTF if you must support that version. See http://www.outlookcode.com/d/formatmsg.htm

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



lucotuslim said:
I am writing the code for MS OUTLOOK 2003 and I intended to copy the code to
other PC that might using 2000, 97...
 
Top