Conditionally change the *message* body font

时间:2015-06-25 18:50:36

标签: outlook automation ms-office

I want to display the body font of emails from a certain sender in Courier New, or another fixed size font, because they contain ASCII tables. All other messages should use the Outlook 2010 default font. Note that I don't care about the font used in the view pane (conditional formatting rules in View settings), or setting the default body font for all messages. I'm asking about an automatic, conditionally set font based on the sender email. If it is not possible to automatically change the message font, what's the quickest way to switch between fonts, when reading and composing messages?

1 个答案:

答案 0 :(得分:2)

您不能开箱即用,特别是对于收到的被认为是只读的消息。

对于您撰写的邮件,您可以使用以下内容更改字体样式:

'set Msg = Application.ActiveExplorer.Selection(1)
set Msg = Application.ActiveInspector.CurrentItem
set insp = Msg.GetInspector
set doc = insp.WordEditor
for each p in doc.Paragraphs
  set r = p.Range
  r.Font.Name = "Arial"
  r.Font.Size = 14
  r.Select
next