By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,080 Members | 1,817 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,080 IT Pros & Developers. It's quick & easy.

Prevent PDF Preview - Lebans Code

P: n/a
Hello,

I am using Leban's PDF code to convert a number of reports to PDF. Once the
PDF is created, they are automatically being emailed. However, the PDF
remains open. I would like to do one of two things:

1) Immediately after opening, have the PDF application close; or better yet
2) Prevent the PDF preview from ever occuring for better efficiency.

Any thoughts?

B

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200702/1

Feb 8 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Not sure what version you are using, but there is a flag setting in the
parameters that
when set...the pdf is NOT opened, nor is it displayed:
eg:

.....strWhere = some complex filtering for the reprot.....
DoCmd.OpenReport strReportName, acViewPreview, , strWhere
Reports(strReportName).Visible = False
Call ConvertReportToPDF(strReportName, , strDocName, False, False)
DoCmd.Close acReport, strReportName

Note the 2nd false parameter in the PDF call....

StartPDFViewer parameter...and when set = false...no preview occurs....
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
Feb 8 '07 #2

P: n/a
Thanks Albert!

My first attempt at PDF conversion. Lebans code is quite long and I missed
the code "Optional StartPDFViewer":

Public Function ConvertReportToPDF( _
Optional RptName As String = "", _
Optional SnapshotName As String = "", _
Optional OutputPDFname As String = "", _
Optional ShowSaveFileDialog As Boolean = False, _
Optional StartPDFViewer As Boolean = False, _
Optional CompressionLevel As Long = 0, _
Optional PasswordOwner As String = "", _
Optional PasswordOpen As String = "", _
Optional PasswordRestrictions As Long = 0, _
Optional PDFNoFontEmbedding As Long = 0 _
) As Boolean

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200702/1

Feb 8 '07 #3

P: n/a
I need to convert the function to a class based object to make it easier for
users to set the params and call the actual function/method.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"bhipwell via AccessMonster.com" <u30281@uwewrote in message
news:6d8270a8f1445@uwe...
Thanks Albert!

My first attempt at PDF conversion. Lebans code is quite long and I
missed
the code "Optional StartPDFViewer":

Public Function ConvertReportToPDF( _
Optional RptName As String = "", _
Optional SnapshotName As String = "", _
Optional OutputPDFname As String = "", _
Optional ShowSaveFileDialog As Boolean = False, _
Optional StartPDFViewer As Boolean = False, _
Optional CompressionLevel As Long = 0, _
Optional PasswordOwner As String = "", _
Optional PasswordOpen As String = "", _
Optional PasswordRestrictions As Long = 0, _
Optional PDFNoFontEmbedding As Long = 0 _
) As Boolean

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200702/1

Feb 8 '07 #4

P: n/a
"Stephen Lebans" <ForEmailGotoMy.WebSite.-WWWdotlebansdot...@linvalid.com>
wrote in message news:Or******************@ursa-nb00s0.nbnet.nb.ca...
>I need to convert the function to a class based object to make it easier
for users to set the params and call the actual function/method.
It is not too bad, since I do have inteli-sense during the coding process.

I have to say (admit) that I not needed to actually look at any of your code
at all. Sorry, as much as I would like to spend time down in that code
seeing how some of that amazing stuff works...I just happy we have it and it
works so well!!!

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
Feb 9 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.