📄 dump_profiles.py
字号:
from win32com.client import Dispatchfrom win32com.mapi import mapifrom win32com.mapi.mapitags import *mapi.MAPIInitialize(None)logonFlags = mapi.MAPI_NO_MAIL | mapi.MAPI_EXTENDEDsession = mapi.MAPILogonEx(0, None, None, logonFlags)MAPI_SUBSYSTEM = 39restriction = mapi.RES_PROPERTY, (mapi.RELOP_EQ, PR_RESOURCE_TYPE, (PR_RESOURCE_TYPE,MAPI_SUBSYSTEM))table = session.GetStatusTable(0)rows = mapi.HrQueryAllRows(table, (PR_DISPLAY_NAME_A,), # columns to retrieve restriction, # only these rows None, # any sort order is fine 0) # any # of results is fineassert len(rows)==1, "Should be exactly one row"(tag, val), = rows[0]print "Profile name:", val
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -