I have the following code
Instead of having a message box, how do I amend the code so that I use If...Then...Else...EndIf to see whether the value exists so that if it exists then return True and if not False. I want to use the above code to delete a registry key but want to check if the registry key exists first, before deleting. Hope that makes sense.
Code:
Set objShell = CreateObject("WScript.Shell")
strKey = "HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\Licence Key Generator\"
RegistryKey1 = objShell.RegRead(strKey & "Path")
MsgBox strKey & "Path: " & vbCrlf & vbCrlf & UCase(RegistryKey1)
Instead of having a message box, how do I amend the code so that I use If...Then...Else...EndIf to see whether the value exists so that if it exists then return True and if not False. I want to use the above code to delete a registry key but want to check if the registry key exists first, before deleting. Hope that makes sense.