Curtis said:
How do I specify the file path directory? Also, it keeps opening the file
after it prints, how do I get it to not open, as I click another button that
attaches it to an email, so I don't need to see it.
blRet = ConvertReportToPDF(Me.PDFApproved, vbNullString, _
Me.CustomerID & ".pdf", False, True, 0, "C:\USMS\", "C:\USMS\", 0, 0)
I have my reports setup with a specific printer (PDF Printer) under Page
Setup, but wanted to know if it is possible to set it up so you can specific
[quoted text clipped - 14 lines]
This is the code from a sample recipe db I wrote - click the button and it
saves the recipe report in a specific location without opening acrobat.
Dim blRet As Boolean
blRet = ConvertReportToPDF("Recipes", vbNullString, "c:\stuff\Recipes2"
& ".pdf", False, False, 0, "", "", 0, 0)
If you check the comments in the Lebans sample you'll find the options for
his function:
'Public Function ConvertReportToPDF( _
'Optional RptName As String = "", _ "Recipes" in my example
'Optional SnapshotName As String = "", _
'Optional OutputPDFname As String = "", _ "c:\stuff\Recipes2" & ".pdf",
in my example
'Optional ShowSaveFileDialog As Boolean = False, _ if you make true you get
file save dialog window
'Optional StartPDFViewer As Boolean = True, _ False will not open acrobat
'Optional CompressionLevel As Long = 0, _ changes compression level
'Optional PasswordOwner As String = "", _
'Optional PasswordOpen As String = "", _
'Optional PasswordRestrictions As Long = 0, _
'Optional PDFNoFontEmbedding as Long = 0 _ font embed enabled =0, disbled=1
you can use variables to build the output name. I'm using this in an
inventory program that generates a unique report number each time a report is
generated. I append that number to the file name so that I have a collection
of all of the reports generated in a format that users can understand.
If you'd like a copy of my recipe db - post your email & I'll send it to you.
Remember to add his ReportToPDF module into the module section of your db.
Unless your using some of his super formatting stuff you don't need the
clsCommonDialog
Cyber-guy