Auto naming PDF files created from Report in W2K 
Author Message
 Auto naming PDF files created from Report in W2K

I am trying to automatically create a pdf file from a report and have a
degree of success. The problem I have is that I want to automatically name
the file which I already do for other reports but with pdfwriter in windows
2000 it needs to write to the registry before it names the file.

I have found the following code but I can't get it to work (I'm a relative
novice at this so am hoping somebody can tell me what is missing and what I
need to do to get it to work).

Private Sub Print_Report_Click()
On Error GoTo Err_Print_Report_Click

Call RegOpenKeyEx(HKEY_CURRENT_USER, "Software\Adobe\Acrobat PDFWriter", 0,

file_path = sPath & "\" & sFileName & ".pdf" & Chr$(0)

Call RegSetValueExString(hKey, "PDFFileName", 0&, REG_SZ, file_path,

Call RegCloseKey(hKey)

When I run the above code I get  the following. "Compile Error: Sub or
Function not defined" on all lines with Call Reg etc on them.

Thanks for any help in advance.


Sun, 09 May 2004 00:01:39 GMT  
 [ 1 post ] 

 Relevant Pages 

1. VBA code to auto name and append successive .pdf "reports" to one .pdf file?

2. Creating a report as PDF directly without showing the report

3. File name for PDF file from RDC

4. set file name for PDF

5. Need Outlook macro to recurse outlook folders and create PDF file of each email

6. Create adobe pdf files from word

7. Creating PDF files from ASP

8. With VB6 create a PDF File

9. With VB6 create a PDF File

10. How to create PDF Files from VB6

11. PDF Files created

12. OCX to create PDF files without Acrobat


Powered by phpBB® Forum Software