Estou tentando definir as fontes padrão no Outlook por meio de manipulação do Registro.
Estou usando o Powershell (mas é acadêmico, já que o código está "funcionando", então eu poderia estar usando o C # ou algo assim).
O código é:
Set-ItemProperty HKCU:\SOFTWARE\Microsoft\Office.0\Common\MailSettings\ -Name ThemeFont -Value 2 -Type DWord
$font = "3c,68,74,6d,6c,3e,0d,0a,0d,0a,3c,68,65,61,64,3e,0d,0a,3c,73,74,79,6c,65,3e,0d,0a,0d,0a,20,2f,2a,20,53,74,79,6c,65,20,44,65,66,69,6e,69,74,69,6f,6e,73,20,2a,2f,0d,0a,20,73,70,61,6e,2e,50,65,72,73,6f,6e,61,6c,43,6f,6d,70,6f,73,65,53,74,79,6c,65,0d,0a,09,7b,6d,73,6f,2d,73,74,79,6c,65,2d,6e,61,6d,65,3a,22,50,65,72,73,6f,6e,61,6c,20,43,6f,6d,70,6f,73,65,20,53,74,79,6c,65,22,3b,0d,0a,09,6d,73,6f,2d,73,74,79,6c,65,2d,74,79,70,65,3a,70,65,72,73,6f,6e,61,6c,2d,63,6f,6d,70,6f,73,65,3b,0d,0a,09,6d,73,6f,2d,73,74,79,6c,65,2d,6e,6f,73,68,6f,77,3a,79,65,73,3b,0d,0a,09,6d,73,6f,2d,73,74,79,6c,65,2d,75,6e,68,69,64,65,3a,6e,6f,3b,0d,0a,09,6d,73,6f,2d,61,6e,73,69,2d,66,6f,6e,74,2d,73,69,7a,65,3a,31,30,2e,30,70,74,3b,0d,0a,09,6d,73,6f,2d,62,69,64,69,2d,66,6f,6e,74,2d,73,69,7a,65,3a,31,31,2e,30,70,74,3b,0d,0a,09,66,6f,6e,74,2d,66,61,6d,69,6c,79,3a,22,41,72,69,61,6c,22,2c,73,61,6e,73,2d,73,65,72,69,66,3b,0d,0a,09,6d,73,6f,2d,61,73,63,69,69,2d,66,6f,6e,74,2d,66,61,6d,69,6c,79,3a,41,72,69,61,6c,3b,0d,0a,09,6d,73,6f,2d,68,61,6e,73,69,2d,66,6f,6e,74,2d,66,61,6d,69,6c,79,3a,41,72,69,61,6c,3b,0d,0a,09,6d,73,6f,2d,62,69,64,69,2d,66,6f,6e,74,2d,66,61,6d,69,6c,79,3a,22,54,69,6d,65,73,20,4e,65,77,20,52,6f,6d,61,6e,22,3b,0d,0a,09,6d,73,6f,2d,62,69,64,69,2d,74,68,65,6d,65,2d,66,6f,6e,74,3a,6d,69,6e,6f,72,2d,62,69,64,69,3b,0d,0a,09,63,6f,6c,6f,72,3a,77,69,6e,64,6f,77,74,65,78,74,3b,7d,0d,0a,2d,2d,3e,0d,0a,3c,2f,73,74,79,6c,65,3e,0d,0a,3c,2f,68,65,61,64,3e,0d,0a,0d,0a,3c,2f,68,74,6d,6c,3e,0d,0a"
$fontSimple ="3C,00,00,00,1F,00,00,F8,00,00,00,40,C8,00,00,00,00,00,00,00,00,00,00,FF,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,00"
$hexified = $font.Split(',') | % { "0x$_"}
$hexifiedSimple = $fontSimple.Split(',') | % { "0x$_"}
Set-ItemProperty HKCU:\SOFTWARE\Microsoft\Office.0\Common\MailSettings\ -Name ComposeFontComplex -type Binary -Value $hexified
Set-ItemProperty HKCU:\SOFTWARE\Microsoft\Office.0\Common\MailSettings\ -Name ReplyFontComplex -type Binary -Value $hexified
Set-ItemProperty HKCU:\SOFTWARE\Microsoft\Office.0\Common\MailSettings\ -Name TextFontComplex -type Binary -Value $hexified
Set-ItemProperty HKCU:\SOFTWARE\Microsoft\Office.0\Common\MailSettings\ -Name ComposeFontSimple -type Binary -Value $hexifiedSimple
Set-ItemProperty HKCU:\SOFTWARE\Microsoft\Office.0\Common\MailSettings\ -Name ReplyFontSimple -type Binary -Value $hexifiedSimple
Set-ItemProperty HKCU:\SOFTWARE\Microsoft\Office.0\Common\MailSettings\ -Name TextFontSimple -type Binary -Value $hexifiedSimple
Quando eu o executo, o registro é atualizado como esperado:
E,deacordocomoregistro,todasasfontessãoasmesmas.
Noentanto,quandoeuolhonasconfiguraçõesdoOutlook,afonteédefinidaassimparaoNewMails(queestácorreto):
Considerandoqueafontederespostaéconfiguradaassim(oquenãoécorreto):
Existe algum outro lugar em que preciso definir algo?