2013-04-04 66 views
5

Có thể thiết lập theo chương trình cài đặt Chữ ký mặc định của Outlook 2013 không? Chúng ta có thể tạo ra chữ ký của người dùng OK nhưng muốn cũng phải thiết lập chữ ký xuất hiện theo mặc định trong email của người dùng:Đặt lập trình mặc định chữ ký Outlook 2013?

Outlook 2013 Email Signature Defaults

Các thiết lập chính nó có vẻ là nhét-xa trong Registry dưới một hồ sơ Outlook:

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

Reg Values:

  • New Signature
  • Reply-Forward Signature

... (mà có dữ liệu nhị phân, có lẽ mã hóa tên tập tin HTML/tài liệu tham khảo).

Không chắc chắn liệu tôi có thể sử dụng Mô hình đối tượng Outlook để truy cập và đặt cài đặt không? Và liệu điều này có thể thực hiện được với ứng dụng ClickOnce không?

+1

Có: http://stackoverflow.com/a/23151372/737393 – CrazyTim

Trả lời

0

Tôi chưa làm sạch mã, nhưng điều này có tác dụng đối với tôi để đặt chữ ký trong Outlook 2013. Trong python (vâng tôi biết nó xấu xí chứ không phải PEP8).

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') 
Các vấn đề liên quan