問題描述
如何在 Outlook 正文中左對齊從 Excel 範圍創建的 HTML 表格? (How to Left‑Align HTML Table, created from an Excel Range, in an Outlook Body?)
我想將選定範圍從 Excel 複製到 Outlook 郵件的正文 (Office 2013)。
表格正在粘貼,居中對齊。
我想粘貼使用左對齊或修改 HTML 表格對像以更改其屬性(例如對齊、WordEditor Inspector 所做的自動換行)。
我試過 objNewEmail.HTMLBody = "
”
。這會將我的表嵌入到另一個表中,並且莫名其妙地,新表是在打開 Text‑Wrapping 的情況下生成的。
我試過
參考解法
方法 1:
A bit late but maybe the solution I found could help. By reading RangetoHTML
value, I noticed that the replacement of align=center x:publishsource=
with align=left x:publishsource=
is not occurring because there is a line break after align=center
.
To fix the problem, just use
RangetoHTML = Replace(RangetoHTML, "align=center", "align=left")
instead of
RangetoHTML = Replace(RangetoHTML, "align=center x:publishsource=", "align=left x:publishsource=")