473,386 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Prevent PDF Preview - Lebans Code

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
4 2019
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
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Bruce Rusk | last post by:
I'm using Stephen Lebans' RTF2 control in a report, and have discovered what may be a slight bug in it. I have a lot of non-Western language (Chinese) text in my RTF field, and such records get...
7
by: Pat | last post by:
I would like to send the Print Preview of a MS Access form to a Snapshot file. The form contains an OLE graph. BACKGROUND A snapshot of a report is possible. If I could I would use a report to...
6
by: Robert | last post by:
Hello. I have been trying out the Lebans ToolTip Classes at http://www.lebans.com/tooltip.htm, to display "balloon" style help tips in a form. The classes I am using are located at...
3
by: Alex Wisnoski | last post by:
I am trying to adapt Lebans' ReportUtilities to export reports (to preserve formatting) from an Access 97 application. I have made the reference to his mde and copied the modules into my db. I...
3
by: Phil Stanton | last post by:
I am trying to produce a program that will output any Access report to an editable Word document. So far it is working well but slowly with text boxes, labels, and lines. I now need to try to...
4
by: Andrew Chanter | last post by:
I recently installed Stephan Lebans calendar control into an application. Only problem is that it always launches at the extreme right of the screen with most of the dialog off screen. I am...
6
by: Sharper | last post by:
I have just downloaded lebans rtf2 which initially looks very interesting. Having a little trouble though in getting the RTF2 toolbar to appear on my own db although it is on the sample. I have...
16
by: DFS | last post by:
If you're listening, I want the middle of the calendar (showing 1 month) to open below the cursor position. It currently opens just to the right and below the cursor position. I hunted through...
6
by: Tim Marshall | last post by:
Does anyone know if Stephen Leban's ConvertReportToPDF for converting mdb reports to pdf can be done for a print preview of a form? A major Access application I've developed and use displays an...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.