[英]Remove Space Between Header and Unordered List (HTML) in VBA Email
我在Excel中使用VBA生成电子邮件。 但是,我最终在<h3>
和<ul>
之间有一个令人讨厌的空白。 我已经查看并尝试了许多不同的解决方案,例如更改padding / margin属性,但仍然总是留有空白:
这是我在HTML正文中使用的代码。 我敢肯定它通常是一团糟,但我想一次解决一个问题。
.HTMLBody = "<Body style=font-size:11pt;font-family:Calibri>" & _
"Here is the latest status for all ITRC breaks, by product. This report is generated using data pulled on " & Format(LastMonday(Date), "m/d") & ".</body>" & _
RangetoHTML(rng_Summary) & _
"<Body style=font-size:9pt;font-family:Calibri>*allows are excluded from Avg. Age of Breaks calculation</Body>" & _
"<h3><u>MANAGEMENT SUMMARY</u></h3>" & _
"<ul style=margin-top:-30px;font-size:11pt;font-family:Calibri>" & _
"<li><u><b>Total # of Breaks</u></b> - " & " " & str_total_breaks_complete & "</li>" & _
"<li><u><b>Average Age of Breaks</u></b> - " & " " & str_avg_age_complete & "</li>" & _
"<li><u><b># of Breaks > 90 Days</u></b> - " & " " & str_breaks_GT90_complete & "</li>" & _
"<li><u><b>Breaks w/o Remedies >30 Days</u></b> - " & no_rmdy_GT30_count & " " & str_GT30_final & final_list_GT30 & "</li>" & _
"<li><u><b>Overdue Remedies</u></b> - " & overdue_rmdy_count & " " & str_overdue_final & final_list_OD & "</li>" & _
"<li><u><b>Allows Expired</u></b> - " & allows_expired_count & " " & str_exp_final & final_list_AX & "</li>" & _
"<li><u><b>Top CPs by Avg. Break Age</u></b>" & final_list_TopCPs & "</li>" & _
"</ul>" & _
"<img src=cid:" & Replace(ageChart_img, " ", "%20") & ">" & "<img src=cid:" & Replace(totalBreak_img, " ", "%20") & ">"
.Display 'CHANGE THIS to .Display/.Send if you want to test/send
margin-bottom: 0;
加margin-bottom: 0;
到你的h3
。
<h3 style='margin-bottom: 0;'><u>MANAGEMENT SUMMARY</u></h3>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.