Diane, still have a problem displaying HTML part in custome form.
I'm getting my textboxes filled on my custom form...but the html table and text is not being displayed.
Here are the key components to the code:
' variables for the email here
Dim strForm As String
Dim objFolder As Folder
Dim objItem As Object 'mailitem
Dim objPage As Variant 'Outlook.Pages
strForm = "IPM.Note.RsvpRedbookApproval"
Set objOL = CreateObject("Outlook.Application")
Set olns = objOL.GetNamespace("MAPI")
Set objFolder = olns.GetDefaultFolder(olFolderInbox)
Set objItem = objFolder.Items.Add("IPM.Note.RsvpRedbookApproval")
Set objPage = objItem.GetInspector.ModifiedFormPages("DsmEmail")
strhtml = "<HTML><Body><table border='1' width='50%'><tr><th>Sku</th><th>PRODUCT_DESCRIPTION</th><th>QTY</th>" & _
"<th>TARGET_PRICE</th><th>COMPETITOR_PRICE</th><th>TARGET_GP</th><th>CURRENT_PRICE</th><th>APPROVED_PRICE</th></tr>"
MAILBODY = strhtml
MAILBODY = MAILBODY & "<tr><td>" & rst("SKU") & "</td><td>" & rst("PRODUCT_DESCRIPTION") & "</td><td>" & _
rst("QTY") & "</td><td>" & Format(rst("TARGET_PRICE"), "Currency") & "</td><td>" & Format(rst("COMPETITOR_PRICE"), "Currency") & _
"</td><td bgcolor=""Red"">" & "No Gp" & "</td><td>" & Format(rst("CURRENT_PRICE"), "Currency") & "</td><td>" & Format(rst("APPROVED_PRICE"), "Currency") & "</td></tr>"
mybody = "Thank you for calling our Quotes Hotline.<br>" & _
"Your Pricing Escalation request has been sent to your Leader for review.<br><br>"
mybody = mybody & "Request #: " & price_escNum & " <br>" & _
"Quote #: " & esc_Quote & "<br>" & _
"Sharepoint #: " & SHAREPOINTID & "<br>" & _
"Price Requested Until : " & PRICE_REQUESTED & "<br>" & _
"Account #: " & esc_AccountNumber & "<br>" & _
"Account Name: " & esc_AccountName & "<br><br>"
mybody2 = "</table><p>Sincerely,<br><br>"
mybody2 = mybody2 & "The CSP Quotations Team.</p>"
' Set MailOutLook = appOutLook.CreateItem(olMailItem) ' commented out
Set MailOutLook = Items.Add("IPM.Note.RsvpRedbookApproval")
objItem.GetInspector.ModifiedFormPages("DsmEmail").Controls("txtPricingEscalationId").Value = price_escNum
With objItem
.SentOnBehalfOfName = "
donotreply@redtions.com"
' .BodyFormat = olFormatRichText
.To = CALLER_NAME_EMAIL '"
david.powell@grainger.com""
.CC = CALLER_DSM_EMAIL
'.CC = "
redtions@xxxxx.com" ' sellers manager
.BCC = "
redtions@xxxx.com"
.Subject = "Pricing #" & price_escNum & " has been escalated to your leader "
.BodyFormat = olFormatHTML
.HTMLBody = mybody & MAILBODY & mybody2
' .Display True
.Send
End With