Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check if registry key exist 1

Status
Not open for further replies.

cmdata

Programmer
Mar 18, 2005
5
SE
Hi!
Is there some one that can help?
I have read and read and test various example, but nothing works.

I whant to check if this registry key exits.
HKEY_CURRENT_USER\Software\ADOBE\Acrobat PDFWriter\bDocInfo\

The check should be done in Access 2000 (VBA).

I some example I have found, there are about 50 rows of code, to do this check. It must be easier way to do this.



 
A starting point:
Dim WshShell As Object
Set WshShell = CreateObject("WScript.Shell")
On Error Resume Next
WshShell.RegRead("HKCU\Software\Adobe\Acrobat PDFWriter\bDocInfo\")
If Err <> 0 Then
MsgBox "Key doesn't exists or has no default value"
Err.Clear
Else
MsgBox "Key exists"
End If
Set WshShell = nothing
On Error Goto yourErrorHandler

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks this works.

This function check if the Key bDocInfo exist,
but if I whant to check if value Acrobat PDFWriter exist
it won't work.
Do you have any idee about this also ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top