通过 VBA 设置默认签名 [英] Setting The Default Signature Via VBA

查看:52
本文介绍了通过 VBA 设置默认签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尽可能地研究了这个主题,但找不到通过 VBA 以编程方式切换默认签名的方法.

I've researched as best as I can on this subject and am unable to find a way of switching the default signature programmatically via VBA.

我希望能够根据一周中的哪一天设置默认签名(我在两个不同的地点工作).当 Outlook 启动时,我希望它将默认签名更改为我指定的签名.

I would like to be able to set a default signature depending on what day of the week it is (I work at two different locations). When Outlook starts up I'd like it to change the default signature to the one I specify.

我开始认为这根本不可能.

I'm starting to think this isn't possible at all.

推荐答案

Outlook 对象模型不提供任何签名.但是您可以在运行时使用 VBA 宏编辑消息正文.

The Outlook object model doesn't provide anythyng for signatures. But you can edit the message body at runtime using VBA macros.

Outlook 对象模型提供了三种处理项目正文的主要方式:

The Outlook object model provides three main ways for working with item bodies:

  1. 正文 - a表示 Outlook 项目的明文正文的字符串.
  2. HTMLBody - a表示指定项的 HTML 正文的字符串.
  3. 文字编辑器 -正在显示的消息的 Microsoft Word 文档对象模型.Inspector 类的 WordEditor 属性从 Word 对象模型返回 Document 类的一个实例,您可以使用它来设置消息正文.
  1. Body - a string representing the clear-text body of the Outlook item.
  2. HTMLBody - a string representing the HTML body of the specified item.
  3. Word editor - the Microsoft Word Document Object Model of the message being displayed. The WordEditor property of the Inspector class returns an instance of the Document class from the Word object model which you can use to set up the message body.

您可以在 第 17 章:使用项目实体.选择自定义消息正文中的签名的方式由您决定.

You can read more about all these ways in the Chapter 17: Working with Item Bodies. It us up to you which way is to choose to customize the signature in the message body.

附言如果您在 Outlook 中更改帐户,签名也会更改.您可以考虑为 Outlook 中的每个帐户分配不同的签名.

P.S. If you change accounts in Outlook the signatures are changed as well. You may consider assigning different signatures for each account in Outlook.

这篇关于通过 VBA 设置默认签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆