gtwmb
asked on
Insert page break in Outlook HTMLBody
Working on a report for an Outlook plug in which could contain one or more tables (using the HMTLBody property of an Outlook message). If the report contains more than one table, I want to insert a page break in between the tables. However, when I do a page preview in Outlook, the tables are all on one page. Does anyone know how to insert a page break into the HTMLBody of an Outlook message?
// newMail defined above
string body = "<br style='page-break-before:always'>";
body += "<table>";
// table code here
body += "</table>";
newMail.HTMLBody = body;
newMail.Display(false);
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
OK - I take that back - it works if it isn't the first table in the message - I guess it assumes you want the first table on the first page (I want them all to be on their own page. I am going to try and put something before the first table and see if it bounces to the second page. I will award you the points because changing to the <p> tag sent me on my way - many thanks!
Your welcome! I'm glad I could help. I did make the assumption you mentioned, this was to break after the first table. Hopefully you will be able to find what you need for the stuff before the first table.
Thanks for the grade, the points and the fun question.
bol
Thanks for the grade, the points and the fun question.
bol
ASKER
You're welcome. I just added one empty <p></p> tag set before the <p class=pageBreak></p> tags and now my print preview shows the message header as page 1, then each table on its own page after that. All is well.
ASKER