P
Pat G
GetRegistryString keeps coming up undefined which DLL do
I need?
I need?
Pat G said:I'm trying to run this sub but it says GetRegistryString
is undefined as a funciton or sub.
Public Sub RunReportAsPDF()
On Error GoTo Err_RunReport
'Folder where PDF file will be written
sPDFPath = "C:\myapp\archive\"
'Save current default printer
sMyDefPrinter = GetRegistryString
(HKEY_CURRENT_USER, "Software\Microsoft\WIndows
NT\CurrentVersion\Windows", "Device")
' Set default printer to PDF Writer
SaveRegistryString
HKEY_CURRENT_USER, "Software\Microsoft\WIndows
NT\CurrentVersion\Windows", "Device", "Acrobat PDFWriter"
sPDFName = "Report.pdf"
' Setting value for PDFFileName in the registry stops
file dialog box from appearing
SaveRegistryString
HKEY_CURRENT_USER, "Software\Adobe\Acrobat
PDFWriter", "PDFFileName", sPDFPath + sPDFName
' Run the report
DoCmd.OpenReport "Report", acPreview
Exit_RunReport:
' Restore default printer
SaveRegistryString
HKEY_CURRENT_USER, "Software\Microsoft\WIndows
NT\CurrentVersion\Windows", "Device", sMyDefPrinter
Exit Sub
Err_RunReport:
MsgBox Err.Description
Resume Exit_RunReport
End Sub