Board logo

標題: [發問] outlook內文如何設定字型為12 ? 是bug嗎? [打印本頁]

作者: PKKO    時間: 2015-12-22 11:09     標題: 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?
  1. Sub Mail_Outlook_With_Signature_Html_1()
  2. ' Working in Office 2000-2013
  3.     Dim OutApp As Object
  4.     Dim OutMail As Object
  5.     Dim strbody As String

  6.     Set OutApp = CreateObject("Outlook.Application")
  7.     Set OutMail = OutApp.CreateItem(0)

  8.     strbody = "p style='font-family:calibri;font-size:16.5'" & "Dear " & Range("D74") & "," (HTML tags not included)

  9.     On Error Resume Next

  10.     With OutMail
  11.         .Display
  12.         .To = Range("H74")
  13.         .CC = ""
  14.         .BCC = ""
  15.         .Subject = ""
  16.         .HTMLBody = strbody & .HTMLBody
  17.         .Display
  18.     End With

  19.     On Error GoTo 0
  20.     Set OutMail = Nothing
  21.     Set OutApp = Nothing
  22. 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嗎?
作者: PKKO    時間: 2015-12-23 21:14

誰有辦法用VBA將OUTLOOK內文變成12字體嗎?




歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)