在Outlook中发送电子邮件时如何为不同的帐户自动使用不同的字体

立即分享:

如果您在 Outlook 中配置了多个电子邮件帐户,并希望根据用于发送的不同电子邮件帐户在外发电子邮件中使用不同的字体,您可以使用本文介绍的方法。

许多用户希望 Outlook 可以根据他们用于发送的不同电子邮件帐户自动选择并在外发电子邮件中使用不同的字体。 但是,默认情况下,Outlook 没有这样的功能。 幸运的是,您仍然可以借助 VBA 代码实现这一点。 现在,我们将详细揭示这个方法。

在 Outlook 中发送电子邮件时为不同的帐户使用不同的字体

发送电子邮件时自动为不同的帐户使用不同的字体

  1. 首先,启动 Outlook 应用程序。
  2. 然后,在随后的 Outlook 主窗口中,您应该按“Alt + F11”键。
  3. 接下来,您将进入一个新窗口——“Microsoft Visual Basic for Applications”。
  4. 在此窗口中,您需要找到并打开“ThisOutlookSession”项目。
  5. 随后,将以下 VBA 代码复制并粘贴到该项目中。
'Occurs when you click "Send" button
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Dim objMail As MailItem
    Dim objMailDocument As Word.Document
 
    If TypeOf Item Is MailItem Then
       Set objMail = Item
       Set objMailDocument = objMail.GetInspector.WordEditor
 
       'Use different fonts based on different send using account
       'Change the accounts and fonts as per your needs
       Select Case objMail.SendUsingAccount
              Case "johnsmith@datanumen.com"
                   With objMailDocument.Range.Font
                        .Name = "Times New Roman"
                        .Size = 13
                        .ColorIndex = wdBlue
                   End With
              Case "team1@datanumen.com"
                   With objMailDocument.Range.Font
                        .Name = "Cambria"
                        .Size = 10
                        .ColorIndex = wdBlack
                   End With
              Case "johnsmith_jonny@outlook.com"
                   With objMailDocument.Range.Font
                        .Name = "Segoe Script"
                        .Size = 8
                        .ColorIndex = wdDarkYellow
                   End With
      End Select
 
      objMail.Save
    End If
End Sub

VBA代码——不同账户使用不同字体

  1. 之后,您最好签署此代码。
  • 首先,单击工具栏中的“工具”按钮。
  • 然后从下拉列表中选择“数字签名”选项。
  • 稍后您可以按照屏幕上的说明完成此任务。
  1. 然后,您可以退出当前窗口并继续更改 Outlook 宏设置以允许签名的 VBA 项目。
  2. 从现在开始,每次发送电子邮件时,Outlook 都会根据发送的电子邮件帐户自动更改外发电子邮件中的字体。

为意外的 Outlook 崩溃做好准备

由于 Outlook 的脆弱性,用户在使用 Outlook 时必须时刻做好应对各种问题的准备。毫无疑问,最关键的步骤之一就是定期备份 Outlook 数据。有了备份,即使原始 Outlook 数据在崩溃中损坏,您仍然可以…… 恢复 Outlook 轻松从备份中恢复数据。此外,建议您在 Outlook 中安装强大的修复工具,例如: DataNumen Outlook Repair. 当备份失败时它会派上用场。

作者简介:

Shirley Zhang 是一位数据恢复专家 DataNumen, Inc.,它是数据恢复技术领域的世界领先者,包括 sql损坏 和 outlook 修复软件产品。 欲了解更多信息,请访问 datanumen.com

立即分享:

评论被关闭。