outlook - 通过 c# 更改 Outlook 个人文具
问题描述
我刚刚开始学习如何使用 Visual Studio 为 Outlook 编写加载项。我很难找到资源来阅读 VSTO。如何无法修改 Outlook 个人信纸下的“新邮件”和“回复或转发邮件”的默认字体?
修改了我的帖子以包含解决方案:
我正在使用此链接中的代码(https://pcloadletter.co.uk/2010/05/19/outlook-default-font-and-signature/)并转换为 c#。对于那些试图做同样的事情的人,这就是我的做法。
private void SetFont()
{
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Office\16.0\Common\MailSettings", true);
// set the font in Outlook and then export it from the registry. Use that value for our code.
string ComposeFontSimple = @"3c,00,00,00,1f,00,00,f8,00,00,00,00,c8,00,00,00,00,00,
00,00,ff,ff,00,dd,00,22,41,72,69,61,6c,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00";
byte[] arrComposeFontSimpleBin = ArrayHexToDec(ComposeFontSimple.Split(','));
key.SetValue("ComposeFontSimple", arrComposeFontSimpleBin, RegistryValueKind.Binary);
}
public static byte[] ArrayHexToDec(string[] arrHex)
{
byte[] arrDec = new byte[arrHex.GetUpperBound(0)];
for (int i = 0; i < arrHex.GetUpperBound(0); i++)
{
if (arrHex[i] == "00")
{
arrDec[i] = 0;
}
else
{
arrDec[i] = byte.Parse(arrHex[i], System.Globalization.NumberStyles.HexNumber);
}
}
return arrDec;
}
解决方案
设置存储在HKCU\Software\Microsoft\Office\%s.0\Common\MailSetting
s。
您想要的值是ReplyFontSimple
- 字体大小从偏移量 12 开始,名称从偏移量 0x1A 开始(0x0 终止的字符串)。
推荐阅读
- loops - 计算 if 循环 SPSS
- python - 检查给定范围之间的条件
- python - 切换到 Pygame 全屏模式只能工作一次
- python - Cython 包含 catkin_pkg 设置错误
- http - 如何为 Rocket.rs 设置 CORS 或 OPTIONS
- mysql - 如何优化我关于在同一个表中连接 3 个表的查询?
- resize - 在 Octave 中移动和调整子图的大小
- php - 我可以在PHP中传递一个像闭包这样的函数吗
- webrtc - 建立WebRTC连接时如何知道通过信令服务器将SDP传递给哪个设备
- c# - Azure 应用服务可以访问 github 存储库中的文件吗?