Sending HTML format report is not working

D

danny

I have been sending RTF report from Ms Access on the body of the email.
I need to send it in HTML format instead, but it is not working. The
body of the email displays the whole source instead of the HTML
formatted body. I have realized that the email format shows "Plain
Text" and "Rich Text" format only. If you have further questions,
please do not hesitate to contact me.
Below there is an example of what I am getting, please check:

<HTML><HEAD><META HTTP-EQUIV="Content-Type"
CONTENT="text/html;charset=windows-1252"><TITLE>Rental
Confirmation said:
<FONT SIZE=5 FACE="Book Antiqua" COLOR=#000000>Order Confirmation</FONT></TD><TD WIDTH=108 ><FONT SIZE=1 FACE="Arial" COLOR=#000000> </FONT></TD><TD WIDTH=348 ><FONT SIZE=5 FACE="Book Antiqua" COLOR=#000000>EZ Wireless Communications</FONT></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 ><TR HEIGHT=21 ><TD WIDTH=4 > <BR></TD><TD WIDTH=92 ><FONT SIZE=3 FACE="Book Antiqua" COLOR=#000000>Order No.:</FONT></TD><TD WIDTH=576 ><FONT SIZE=3 FACE="Book Antiqua" COLOR=#000000>7251</FONT></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 ><TR HEIGHT=15 ><TD WIDTH=4 > <BR></TD><TD WIDTH=668 ><FONT SIZE=1 FACE="Book Antiqua" COLOR=#000000>Your cellular phone rental order has been received and processed. Please confirm the following rental information:</FONT></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 ><TR HEIGHT=21 ><TD WIDTH=8 > <BR></TD><TD WIDTH=372 ><B><U><FONT SIZE=3 FACE="Book Antiqua" COLOR=#0000ff>Customer Information:</FONT></B></U></TD><TD WIDTH=292 ><B><U><FONT SIZE=3 FACE="Book Antiqua" COLOR=#0000ff>Delivery Information:</FONT></B></U></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 ><TR HEIGHT=15 ><TD WIDTH=8 > <BR></TD><TD WIDTH=372 ><FONT SIZE= .......Etc......

If you copy the whole source in a HTML editor like dreamweaver, it
gives you the exact format.
I do not know if I have to change a setting in ms outlook or change the
code I have which is:

Dim strline, strHTML
Dim OL As Outlook.Application
Dim MyItem As Outlook.MailItem
Set OL = New Outlook.Application
Set MyItem = Outlook.Application.CreateItem(olMailItem)

If Me.Status Like "*Reserved*" Or Me.Status Like "*rent*" Then
DoCmd.OutputTo acOutputReport, "Rental Confirmation", acFormatHTML,
"C:\Order.html"
MyItem.Subject = "ORDER CONFIRMATION - Cellular phone rental Order" & "
" & Me.Invoice_No
End If

Open "C:\Order.html" For Input As 1
Do While Not EOF(1)
Input #1, strline
strHTML = strHTML & strline
Loop
Close 1
If Left(OL.Version, 2) = "10" Then
MyItem.bodyformat = olFormatHTML
End if
MyItem.Body = strHTML
MyItem.To = Me.email
MyItem.Display

End Sub
Thank you in advance for your help.
 
S

Sue Mosher [MVP-Outlook]

You need to set HTMLBody, not Body.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
D

danny

Dear Sue Mosher,

Thank you for your reply. I have done the HTMLBody instead, but the
message format is still in Rich Text. I got to menu, Format and shows
Rich Text and Plain only. I do not know if Outlook 2000 supports HTML
when sending a HTML report in body from ms access. Is that possible?

Thank you
 
D

danny

Dear Sue Mosher,

Your solution solved the problem. Thank you very much!!!

Best Regards

Danny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top