以编程方式禁用 Outlook 2003 Toast 通知

本文关键字:2003 Toast 通知 Outlook 编程 方式禁 | 更新日期: 2023-09-27 18:36:52

希望有一个简单的答案,但是否可以以编程方式禁用 Outlook 2003 Toast 弹出通知?

注意:我正在使用 c#。

以编程方式禁用 Outlook 2003 Toast 通知

HKEY_CURRENT_USER'Software'Microsoft'Office'<version number here>'Outlook'Preferences'NewmailDesktopAlerts

将其更改为零。

感谢弗兰克·怀特给了我最初的线索:)

这是我问题的完整答案。

using Microsoft.Win32;
//this will create the subkey or if it already exists will just get the location. there is //no getsubkey in the registryclass
RegistryKey rkRegOutlookPreferences = Registry.CurrentUser.CreateSubKey(@"Software'Microsoft'Office'11.0'Outlook'Preferences");
//this will add in or change a value in that subkey
rkRegOutlookPreferences.SetValue("NewmailDesktopAlerts", "0", RegistryValueKind.DWord);
//there is also getValue; this will return a null if the value doesnt exist
rkRegOutlookPreferences.GetValue("NewmailDesktopAlerts")
//and deleting 
rkRegOutlookPreferences.DeleteValue("NewmailDesktopAlerts");

还有更多,但这完成了我问题的完整答案。再次感谢弗兰克·怀特(Frank White)为我迈出了第一步。