如何在 Outlook 正文中左對齊從 Excel 範圍創建的 HTML 表格? (How to Left-Align HTML Table, created from an Excel Range, in an Outlook Body?)


問題描述

如何在 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=")

(by jesusu2Ussy1649)

參考文件

  1. How to Left‑Align HTML Table, created from an Excel Range, in an Outlook Body? (CC BY‑SA 2.5/3.0/4.0)

#outlook #css #excel #html #vba






相關問題

Outlook 2007/2010 中的 Vspace (Vspace in Outlook 2007/2010)

Outlook 2010 自動完成流(緩存的聯繫人) (Outlook 2010 autocomplete stream ( cached contacts))

如何格式化電子郵件中的字符串以便 Outlook 打印換行符? (How do I format a String in an email so Outlook will print the line breaks?)

通過 Office 加載項將內容添加到 Outlook 電子郵件正文 (Adding content to an Outlook email body via an Office Add-In)

Outlook Addin 中的 Recipient.Name 和 ExchangeUser.Name 有什麼區別? (What is the Difference Between Recipient.Name and ExchangeUser.Name in Outlook Addin?)

運行時錯誤,用於電子郵件自動化的 VBA EXCEL (Runtime Error, VBA EXCEL for email automation)

將 Crystal Reports 轉換為 HTML 並作為正文發送到我的郵件中 (Crystal Reports into HTML and sending in my mail as body)

通過 VBA 將格式化的電子郵件正文複製到新的 Word 文檔中並保留文本格式 (Copy formatted Email body into new Word document via VBA and keep the text formatting)

Outlook 在啟動時忽略加載項的 HKEY_LOCAL_MACHINE 條目 (Outlook ignoring HKEY_LOCAL_MACHINE entry for add-in on startup)

如何知道是否收到或發送了電子郵件? (How to know if an e-mail was received or sent?)

如何從 Excel 表格創建電子郵件? (How to create emails from Excel table?)

如何在 Outlook 正文中左對齊從 Excel 範圍創建的 HTML 表格? (How to Left-Align HTML Table, created from an Excel Range, in an Outlook Body?)







留言討論