我在Do While循环中从Excel中获取值,并且每次循环运行时,每个值都粘贴在Outlook邮件中。我想在Outlook中以 BOLD 字体以及CAPS格式显示该值。
Do until k = row_cnt
val1 = Worksheets("Sheet1").Range("A" & k).Value
Set myApp = CreateObject("Outlook.Application")
Set myItem = myApp.CreateItem(olMailItem)
With myItem
.Subject = subj
.To = email_add
.HTMLBody = "Hello " & val1 & "Thanks"
.Display
'.send
End With
Loop
答案 0 :(得分:1)
这将使粗体和大写:
.HTMLBody = "Hello <b>" & UCase$(val1) & "</b> Thanks"
你也可以使用更强大的内联风格
.HTMLBody = "Hello <span style='font-weight:bold !important;'>" & UCase$(val1) & "</span> Thanks"
或者如果您想使用内联样式完成所有操作:
.HTMLBody = "Hello <span style='font-weight:bold; text-transform:uppercase;'>" & val1 & "</span> Thanks"