Reading the registry

Oct 18
2010

Our custom PDF printer has a flaw which requires the user to configure the printer to print directly to the file otherwise the reports are spooled and printed into the incorrect name.

I used this function to check the setting and warn the user

Function GetPrinter()
If fReturnRegKeyValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\EMS PDF\DsSpooler", "printSpooling") = "PrintWhileSpooling" Then
    MsgBox "Your printer is not configured correctly. " & vbCrLf & "change the advanced setting to print directly to the printer"
Else
    MsgBox "Your Setting is correct:" & fReturnRegKeyValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\EMS PDF\DsSpooler", "printSpooling")
End If
 
End Function

This uses the function from the access web

If you need some help on a project drop leave a comment on the post and I will reply.