G
Guest
Hi All
Got a bit of a problem here, I've written this code below to make changes to
registry key 'Mark Comments With' e-mail option in Outlook. Without closing
and reopening Outlook, the new value isn't recognised by Outlook when the
change to the registry is done using this code, whereas when the change is
made using the Tools|Options menu, the change is made and Outlook applies the
change straight away.
So my question is this, is it possible to make this registry value change
and have Outlook apply the change immediately using VBA?
Thanks in advance,
Digga
Code below:
Sub MarkComments()
Dim WshShell, regKey
Set WshShell = CreateObject("WScript.Shell")
regKey =
WshShell.RegRead("HKCU\Software\Microsoft\Office\11.0\Common\MailSettings\MarkComments")
If regKey = "0" Then
WshShell.RegWrite
"HKCU\Software\Microsoft\Office\11.0\Common\MailSettings\MarkComments", "1",
"REG_DWORD"
MsgBox "Mark Comments Value - set to TRUE"
End If
If regKey = "1" Then
WshShell.RegWrite
"HKCU\Software\Microsoft\Office\11.0\Common\MailSettings\MarkComments", "0",
"REG_DWORD"
MsgBox "Mark Comments Value - set to FALSE"
End If
Set WshShell = Nothing
Set regKey = Nothing
End Sub
Got a bit of a problem here, I've written this code below to make changes to
registry key 'Mark Comments With' e-mail option in Outlook. Without closing
and reopening Outlook, the new value isn't recognised by Outlook when the
change to the registry is done using this code, whereas when the change is
made using the Tools|Options menu, the change is made and Outlook applies the
change straight away.
So my question is this, is it possible to make this registry value change
and have Outlook apply the change immediately using VBA?
Thanks in advance,
Digga
Code below:
Sub MarkComments()
Dim WshShell, regKey
Set WshShell = CreateObject("WScript.Shell")
regKey =
WshShell.RegRead("HKCU\Software\Microsoft\Office\11.0\Common\MailSettings\MarkComments")
If regKey = "0" Then
WshShell.RegWrite
"HKCU\Software\Microsoft\Office\11.0\Common\MailSettings\MarkComments", "1",
"REG_DWORD"
MsgBox "Mark Comments Value - set to TRUE"
End If
If regKey = "1" Then
WshShell.RegWrite
"HKCU\Software\Microsoft\Office\11.0\Common\MailSettings\MarkComments", "0",
"REG_DWORD"
MsgBox "Mark Comments Value - set to FALSE"
End If
Set WshShell = Nothing
Set regKey = Nothing
End Sub