Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook - General Queries (http://www.outlookbanter.com/outlook-general-queries/)
-   -   Sending HTML format report is not working (http://www.outlookbanter.com/outlook-general-queries/8468-sending-html-format-report-not.html)

[email protected] March 16th 06 05:30 PM

Sending HTML format report is not working
 
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:

HTMLHEADMETA HTTP-EQUIV="Content-Type"
CONTENT="text/html;charset=windows-1252"TITLERental
Confirmation/TITLE/HEADBODYTABLE BORDER=0 CELLSPACING=0
CELLPADDING=0 TR HEIGHT=31 TD WIDTH=4 BR/TDTD WIDTH=228
FONT SIZE=5 FACE="Book Antiqua" COLOR=#000000Order Confirmation/FONT/TDTD WIDTH=108 FONT SIZE=1 FACE="Arial" COLOR=#000000 /FONT/TDTD WIDTH=348 FONT SIZE=5 FACE="Book Antiqua" COLOR=#000000EZ Wireless Communications/FONT/TD/TR/TABLETABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 TR HEIGHT=21 TD WIDTH=4 BR/TDTD WIDTH=92 FONT SIZE=3 FACE="Book Antiqua" COLOR=#000000Order No.:/FONT/TDTD WIDTH=576 FONT SIZE=3 FACE="Book Antiqua" COLOR=#0000007251/FONT/TD/TR/TABLETABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 TR HEIGHT=15 TD WIDTH=4 BR/TDTD WIDTH=668 FONT SIZE=1 FACE="Book Antiqua" COLOR=#000000Your cellular phone rental order has been received and processed. Please confirm the following rental information:/FONT/TD/TR/TABLETABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 TR HEIGHT=21 TD WIDTH=8 BR/TDTD WIDTH=372 BUFONT SIZE=3 FACE="Book Antiqua" COLOR=#0000ffCustomer Information:/FONT/B/U/TDTD WIDTH=292 BUFONT SIZE=3 FACE="Book Antiqua" COLOR=#0000ffDelivery Information:/FONT/B/U/TD/TR/TABLETABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 TR HEIGHT=15 TD WIDTH=8 BR/TDTD 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.


Sue Mosher [MVP-Outlook] March 16th 06 06:02 PM

Sending HTML format report is not working
 
You need to set HTMLBody, not Body.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

wrote in message ups.com...
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:

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.


[email protected] March 16th 06 06:55 PM

Sending HTML format report is not working
 
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


[email protected] March 16th 06 07:07 PM

Sending HTML format report is not working
 
Dear Sue Mosher,

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

Best Regards

Danny



All times are GMT +1. The time now is 01:19 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com