- 帖子
- 549
- 主題
- 152
- 精華
- 0
- 積分
- 691
- 點名
- 0
- 作業系統
- WIN7
- 軟體版本
- OFFICE 2010
- 閱讀權限
- 50
- 性別
- 男
- 註冊時間
- 2013-8-10
- 最後登錄
- 2022-9-7
 
|
[發問] outlook內文如何設定字型為12 ? 是bug嗎?
http://www.mrexcel.com/forum/excel-questions/709814-email-formatting-when-using-visual-basic-applications-open-outlook.html
這是國外論壇的網址,他跟我遇到相同的問題,可以設定字型為11.5, 12.5 就是不能12?似乎是一個bug?- Sub Mail_Outlook_With_Signature_Html_1()
- ' Working in Office 2000-2013
- Dim OutApp As Object
- Dim OutMail As Object
- Dim strbody As String
- Set OutApp = CreateObject("Outlook.Application")
- Set OutMail = OutApp.CreateItem(0)
- strbody = "p style='font-family:calibri;font-size:16.5'" & "Dear " & Range("D74") & "," (HTML tags not included)
- On Error Resume Next
- With OutMail
- .Display
- .To = Range("H74")
- .CC = ""
- .BCC = ""
- .Subject = ""
- .HTMLBody = strbody & .HTMLBody
- .Display
- End With
- On Error GoTo 0
- Set OutMail = Nothing
- Set OutApp = Nothing
- End Sub
複製代碼 strbody = "p style='font-family:calibri;font-size:16.5'" & "Dear " & Range("D74") & ", "
這樣字型會變成12.5
If I change the font-size to 15 or 15.5, actual size in email is 11.5.
If I change it to 16, actual size is 10.
If I change it to 17, actual size is 13.
If I change it to 16.5, actual size is 12.5.
照理來說設定為16應該就是12了,但卻變成10的字體,難道真的無法透過VBA設定outlook內文的字體大小為12嗎? |
|