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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export to PDF 1

Status
Not open for further replies.

KatGraham

Programmer
Feb 12, 2003
58
US
Does anyone know how to export a report as a PDF?
 
Kat,
Assign it to the Acrobat Distiller printer. If you do this, there is a default Distiller option:
&quot;File|Preferences|View Pdf<something>, which you will probably want to turn off in order to keep it from popping up every time you create a pdf report.

Tranman
 
I use the Docucom PDF printer from Zeon. It works very well and is cheaper than Adobe Acrobat.

To specify file name etc you just need to manipulate some registry strings. If you need some code in the future, let me know & I can post it.

Ben

----------------------------------------------
Ben O'Hara &quot;Where are all the stupid people from...
...And how'd they get so dumb?&quot;
rockband.gif
NoFX-The Decline
----------------------------------------------
 
I am looking at similar issues. I am interested in seeing the code please.
 
It's only valid if you have version 5 (or later I think) of the DocuCom PDF Driver, but basically it works in 3 stages.
Stage 1: Sets up general settings ready to accept automated prints:

Sub PDFSettings()
Dim Sh
Dim key
Set Sh = CreateObject(&quot;WScript.Shell&quot;)
key = &quot;HKEY_CURRENT_USER\&quot;
Sh.RegWrite key & &quot;Software\Zeon\DocuCom\PDF Driver\General\&quot;, &quot;&quot;
Sh.RegWrite key & &quot;Software\Zeon\DocuCom\PDF Driver\General\bMSOFFICE&quot;, &quot;1&quot;, &quot;REG_SZ&quot;
Sh.RegWrite key & &quot;Software\Zeon\DocuCom\PDF Driver\General\WebViewing&quot;, &quot;1&quot;, &quot;REG_SZ&quot;
Sh.RegWrite key & &quot;Software\Zeon\DocuCom\PDF Driver\General\StandardPage&quot;, &quot;3&quot;, &quot;REG_SZ&quot;
Sh.RegWrite key & &quot;Software\Zeon\DocuCom\PDF Driver\General\bViewPDF&quot;, &quot;0&quot;, &quot;REG_SZ&quot;
End Sub

then for each printout you want to specify the filename for:

Private Sub ChangePDFName(strFileName )
Dim Sh
Dim key

Set Sh = CreateObject(&quot;WScript.Shell&quot;)
key = &quot;HKEY_CURRENT_USER\Software\Zeon\DocuCom\PDF DRIVER\Destination\&quot;
Sh.RegWrite key & &quot;PDFName&quot;, strFileName, &quot;REG_SZ&quot;
Sh.RegWrite key & &quot;NamingMode&quot;, &quot;1&quot;, &quot;REG_SZ&quot;
Sh.RegWrite key & &quot;FileExistRule&quot;, &quot;1&quot;, &quot;REG_SZ&quot;
End Sub

and finally reset everything for the next time you print:

Sub ResetPDFSettings()
Dim Sh
Dim key
Set Sh = CreateObject(&quot;WScript.Shell&quot;)
Sh.RegDelete &quot;HKEY_CURRENT_USER\Software\zeon\docucom\pdf driver\Destination\&quot;
Sh.RegDelete &quot;HKEY_CURRENT_USER\Software\zeon\docucom\pdf driver\General\&quot;
End Sub

so your code will look like:

Application.ActivePrinter = &quot;DocuCom PDF Driver on LPT1:&quot;
Call PDFSettings()
ChangePDFName(&quot;C:\report1.pdf&quot;)
Docmd.openReport &quot;Report1&quot;
ChangePDFName(&quot;C:\report2.pdf&quot;)
Docmd.openReport &quot;Report2&quot;
ChangePDFName(&quot;C:\report3.pdf&quot;)
Docmd.openReport &quot;Report3&quot;
Call ResetPDFSettings()

and so on.

All the registry settings come from the SDK pdf I downloaded from the Zeon website.

hth

Ben

----------------------------------------------
Ben O'Hara &quot;Where are all the stupid people from...
...And how'd they get so dumb?&quot;
rockband.gif
NoFX-The Decline
----------------------------------------------
 
i cannot find file preferences??

can someone help pls?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top