是否以编程方式设置Outlook 2013签名默认值?

是否以编程方式设置Outlook 2013签名默认值?,outlook,office-interop,outlook-2013,Outlook,Office Interop,Outlook 2013,是否可以通过编程方式设置Outlook 2013默认签名设置?我们可以生成用户的签名,但也希望将签名设置为默认显示在用户的电子邮件中: 设置本身似乎隐藏在Outlook配置文件下的注册表中: HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Profiles\Outlook\9375CFF041311D3B88A00104B2A6677\00000002 注册值: 新签名 回复转发签名 。。。(具有二进制数据,可能编码HTML

是否可以通过编程方式设置Outlook 2013默认签名设置?我们可以生成用户的签名,但也希望将签名设置为默认显示在用户的电子邮件中:

设置本身似乎隐藏在Outlook配置文件下的注册表中:

HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Profiles\Outlook\9375CFF041311D3B88A00104B2A6677\00000002

注册值:

  • 新签名
  • 回复转发签名
。。。(具有二进制数据,可能编码HTML文件名/引用)


不确定是否可以使用Outlook对象模型访问和设置设置?ClickOnce应用程序是否可以实现这一点?

我还没有清理代码,但这对我在Outlook 2013中设置签名很有用。在python中(是的,我知道它很难看,而不是PEP8)


Outlook签名在配置文件数据(存储在注册表中)中按每个帐户设置。您可以在-单击
IOlkAccountManager
按钮并双击帐户中看到数据


只能在C++或Delphi中访问。如果使用是一个选项(它可以从任何语言使用,包括VBA或.Net,我是它的作者),它将公开。

ReplySignature
NewMessageSignature
属性

是:这在Outlook 2016/2019中不起作用,因为签名现在是按每个帐户存储的。
import _winreg
def set_default():

    try:
        #this makes it so users can't change it.
        outlook_2013_key = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Office\15.0\Common\MailSettings", 0, _winreg.KEY_ALL_ACCESS)
        _winreg.SetValueEx(outlook_2013_key, "NewSignature", 0, _winreg.REG_SZ, "default" )
        _winreg.SetValueEx(outlook_2013_key, "ReplySignature", 0, _winreg.REG_SZ, "default" )

        # sets the sigs in outlook profile
        outlook_2013_base_key = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Office\15.0\Outlook\Profiles", 0, _winreg.KEY_ALL_ACCESS)
        default_profile_2013_tup = _winreg.QueryValueEx(outlook_2013_base_key,'DefaultProfile')
        default_profile_2013 = default_profile_2013_tup[0]
        print default_profile_2013
        outlook_2013_profile_key = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER,
                                                   "Software\\Microsoft\\Office\\15.0\\Outlook\\Profiles\\" + default_profile_2013 + "\\9375CFF0413111d3B88A00104B2A6676", 0, _winreg.KEY_ALL_ACCESS)
        for i in range(0, 10):
            try:
                outlook_2013_sub_key_name = _winreg.EnumKey(outlook_2013_profile_key,i)
                print outlook_2013_sub_key_name, "sub_key_name"
                outlook_2013_sub_key = _winreg.OpenKey(outlook_2013_profile_key, outlook_2013_sub_key_name, 0, _winreg.KEY_ALL_ACCESS)
                _winreg.SetValueEx(outlook_2013_sub_key, "New Signature", 0, _winreg.REG_SZ, "default" )
                _winreg.SetValueEx(outlook_2013_sub_key, "Reply-Forward Signature", 0, _winreg.REG_SZ, "default" )
            except:
                pass

    except:
        print('no 2013 found')