我目前有一個電子表格,用於生成海量電子郵件,可以使用HTML格式進行格式化,並且效果非常好。我一直無法弄清楚的是,是否有一種方法可以將CSS樣式合併到通過excel創建的HTML電子郵件中。在Excel生成的電子郵件中使用CSS和.HTMLBody/olFormatHTML
有沒有人試過這個/以前有過成功?
我目前使用子程序Outlook應用程序構建材料到HTML電子郵件。調用/構造的代碼是:
Sub Test_Email(what_address As String, subject_line As String, mail_body_message As String)
Dim olApp As Outlook.Application
Dim oAttatch As Outlook.Attachment
Set olApp = CreateObject("Outlook.Application")
Dim olMail As Outlook.MailItem
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = what_address
.Subject = "My Subject"
.BodyFormat = olFormatHTML
.HTMLBody = mail_body_message
'mail_body_message is all text that resides in Cell A1 and it consists of body text of the email as well as the HTML tags that I use to organize the message display
.Display
End With
End Sub
在單元格A1中,我有我的所有消息信息。從<HTML> </HTML>
開始並結束,然後我的郵件正文位於標籤內。到目前爲止,當我試圖在單元格A1中的現有HTML中插入CSS樣式時,它將HTML吐出,但將CSS作爲文本對待。
您將需要添加準確描述你現在如何建立這些電子郵件的詳細信息... –
謝謝你,蒂姆。我更新了我的OP。 – user3794203
http://stackoverflow.com/questions/4829254/best-practices-for-styling-html-emails –