【问题标题】:Setting Default Signature selection in Outlook在 Outlook 中设置默认签名选择
【发布时间】:2020-06-24 06:09:49
【问题描述】:

我在论坛上找不到这个问题的答案,或者我的查询输入不够准确。

在我的工作场所使用 Outlook 2010 时,当我加载 Outlook 时,默认签名块不断更改为默认选项。我无权访问源文件进行任何更改,因为它都是服务器端的。

我想要做的是将我的签名的默认选择从旧的更改为新的。

在文件 -> 选项 -> 邮件 -> 签名下 我想在使用某种形式的 VBA 代码启动 Outlook 2010 时将我的默认签名更改为其他内容。有什么办法可以做到这一点?

我已经创建了新的签名,但每次登录终端时都需要重新选择它作为默认选项,这很令人沮丧。

请寻求任何帮助。

【问题讨论】:

标签: vba outlook


【解决方案1】:

粗略搜索后,看起来 Outlook 签名是通过 Windows 注册表管理的(例如,请参阅 herehere)。具体的注册表路径似乎取决于您的 Outlook 版本。

当然,如果是您的工作电子邮件,您可能无法对注册表进行任何更改。

但是,如果您只想在任何新电子邮件中自动插入一些特定文本,则可以通过 VBA 完成。基本上,您想使用新电子邮件的Open 事件来插入特定文本。为此,您需要在ItemLoad 事件期间添加Open 挂钩。像这样的:

' declare the mail item that will have the Open event available
Public WithEvents myItem As Outlook.mailItem

' defines how the Open event will be handled
' note that you only want to do this with unsent items
' (hence the .Sent check)
Private Sub myItem_Open(cancel As Boolean)
   If Not myItem.Sent Then
      'insert your signature text here
   End If
End Sub

' hooks the Open event to a mail item using the ItemLoad event
Private Sub Application_ItemLoad(ByVal Item As Object)
   Dim mailItem As Outlook.mailItem

   If Item.Class = OlObjectClass.olMail Then
      Set myItem = Item
   End If
End Sub

有关详细信息,请参阅有关 Application.ItemLoad 事件和 MailItem.Open 事件的相关 Microsoft 文章。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-03-25
  • 2017-12-11
  • 2020-03-13
  • 1970-01-01
  • 2011-04-14
相关资源
最近更新 更多