Outlook registry - How do I programmatically interpret the registr

R

Reb DeWinter

Hi, there. I'm trying to access the master category list in Outlook
programmatically. I've figured out how to get to the registry file
programmatically, but I don't know how to interpret the contents since they
are shown as binary in my code and I need to see the text values. Here is
the code:

Module Module1
Sub ReadRegistry(ByVal ParentKey As RegistryKey, ByVal SubKey As String, _
ByVal ValueName As String, ByRef Value As Object)

Dim Key As RegistryKey

Try
'Open the registry key.
Key = ParentKey.OpenSubKey(SubKey, True)
If Key Is Nothing Then 'if the key doesn't exist
Throw New Exception("The registry key doesn't exist")
End If

'Get the value.
Value = Key.GetValue(ValueName)
MsgBox("value is " & CStr(Value))
Console.WriteLine("Value:{0} for {1} is successfully
retrieved.", Value, ValueName)
Catch e As Exception
MsgBox("Error in sub. " & Err.Description)
End Try
End Sub

Sub Main()
Dim Value As Object
'HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Categories
ReadRegistry(Registry.CurrentUser,
"Software\Microsoft\Office\11.0\Outlook\Categories", "MasterList", Value)

Console.ReadLine()
End Sub

End Module

Help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top