Export to PDF without saving?

foshizzle

Registered User.
Local time
Today, 17:54
Joined
Nov 27, 2013
Messages
277
I have some code below that exports a report to PDF.
It works fine, I just want to know if it's possible to export the PDF without saving it? I can't seem to find anything on my search about it.

Code:
'Open Report From Query
DoCmd.OpenReport "rpt_BLT_PrintReport", acViewPreview, Me.Filter

'Output Form to PDF
Dim strUserName As String, strPath As String
strUserName = Environ("username")
strPath = "C:\Users\" & strUserName & "\Documents\PoliceReport.pdf"
DoCmd.OutputTo acOutputReport, "rpt_BLT_PrintReport", acFormatPDF, strPath, True

'Close Report
DoCmd.Close acReport, "rpt_BLT_PrintReport"
 
Define "export" and "export without saving".

Immaculate conception springs to mind.
 
I have a report based off a query. Then I have a report to just format what I want the data to look like. All I want to do at this time, is be able to open a PDF instead of the report - if that makes sense. I dont want it to prompt them to save it and I dont want to have to specify a path. I'm assuming most users will only want to view the data one time.
 
Do you mean export or are you saying you want to open the report in print preview mode?
 
Not Report preview.
Just open the report as a PDF. I can do it with excel but can't get it to just "preview" to PDF without saving a copy of the PDF somewhere.

On another note, if that's not possible, would you know how I could add code to my vba somewhere to remove the PDF file once it's created and left the code as is?
 

Users who are viewing this thread

Back
Top Bottom