473,383 Members | 1,876 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,383 software developers and data experts.

Wait for PDF printing to stop before next code

I have code that opens and prints a report using the Adobe PDF printer
driver. The problem is that Access VB executes the next step in code
before the PDF "Printer" is done "printing". Since the "printing"
happens outside of Access's control, Access thinks the printing is done
too early and moves on---but Adobe is still working.

I've tried the DoEvents, but that doesn't help...probably because the
PDF "Printing" process in not linked to Access. How can I get access to
wait for the pdf to stop "printing" before Access moves on?

TIA...

Nov 13 '05 #1
4 7978

John wrote:
I have code that opens and prints a report using the Adobe PDF printer driver. The problem is that Access VB executes the next step in code
before the PDF "Printer" is done "printing". Since the "printing"
happens outside of Access's control, Access thinks the printing is done too early and moves on---but Adobe is still working.

I've tried the DoEvents, but that doesn't help...probably because the
PDF "Printing" process in not linked to Access. How can I get access to wait for the pdf to stop "printing" before Access moves on?

TIA...


In a similar situation, I have this:

objWord.ActivePrinter = "Adobe PDF"
objWord.ActiveDocument.PrintOut printtofile:=True,
outputfilename:=PSfilename

Do While objWord.BackgroundPrintingStatus > 0
Sleep (1000)
Loop

I am sending the print command to a dynamically generated Word doc
instead (objWord.ActiveDocument), but perhaps you can modify to suit
your particulars.

Nicole

Nov 13 '05 #2
ni*****@namg.com wrote:
John wrote:
I have code that opens and prints a report using the Adobe PDF


printer
driver. The problem is that Access VB executes the next step in code
before the PDF "Printer" is done "printing". Since the "printing"
happens outside of Access's control, Access thinks the printing is


done
too early and moves on---but Adobe is still working.

I've tried the DoEvents, but that doesn't help...probably because the
PDF "Printing" process in not linked to Access. How can I get access


to
wait for the pdf to stop "printing" before Access moves on?

TIA...

In a similar situation, I have this:

objWord.ActivePrinter = "Adobe PDF"
objWord.ActiveDocument.PrintOut printtofile:=True,
outputfilename:=PSfilename

Do While objWord.BackgroundPrintingStatus > 0
Sleep (1000)
Loop


Can't you just specify don't print in the background?

objWord.Application.Options.PrintBackground = False
or
objWord.ActiveDocument.PrintOut Background:=False

I think that works, but its been awhile since I dealt with this...
--
'---------------
'John Mishefske
'---------------
Nov 13 '05 #3
The Access code doesn't stop just because Word is printing, it forges
ahead. This is probably a good thing overall. I actually put the
pause step later down in the code so that Access can complete as much
work as possible, and it's only the larger docs that take longer to
print that ever end up pausing the program. (Pause before it gets to
the section where I need to do something with the finished file, that
it.)

However, the original poster might not be using Word -- I was just
posting an example of a loop that will pause code, since he seemed to
be headed in the that direction anyway.

Nov 13 '05 #4
I'm not using Word...only Access. I've had to work around the problem.
Thanks for the suggestions tho!
ni*****@namg.com wrote:
The Access code doesn't stop just because Word is printing, it forges
ahead. This is probably a good thing overall. I actually put the
pause step later down in the code so that Access can complete as much
work as possible, and it's only the larger docs that take longer to
print that ever end up pausing the program. (Pause before it gets to
the section where I need to do something with the finished file, that
it.)

However, the original poster might not be using Word -- I was just
posting an example of a loop that will pause code, since he seemed to
be headed in the that direction anyway.


Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
1
by: NickB | last post by:
Please could someone tell me what is wrong. Ther error is: An unhandled exception of type 'System.NullReferenceException' occurred in microsoft.visualbasic.dll Additional information: Object...
9
by: cantelow | last post by:
Hi. I've got a program printing multiple pdf reports, and I need to wait for completion of various associated operations- The pdf printer prints to one file, then I need to copy that where I need...
7
by: teachtiro | last post by:
Hi, 'C' says \ is the escape character to be used when characters are to be interpreted in an uncommon sense, e.g. \t usage in printf(), but for printing % through printf(), i have read that %%...
2
by: kumarmanoj_pat | last post by:
hi, i want to write a program to print text on printer through printer object. i also want to stop printing just after printing text. now if, i print text then printer eject whole page and move to...
14
by: stephen.durkin | last post by:
I've gathered that javascript doesn't have a handy wait() function, so I made the following function makeDelay() to make use of PHP's sleep(), which then does the waiting, and responds with...
9
by: Gurbinder Kaur | last post by:
Hi, i have made a project for printing fee receipt. Using Windows-XP, VBasic 6.0 & Ms-Access-97. i have designed a form for prinring receipts. m paper-size is 5x10. Two copies of bills in this...
3
trkrbabe
by: trkrbabe | last post by:
Hi, this is my first time posting here. It appears that I am taking the same class as a few other people here. I have only been learning Java for about five weeks now. I have my Product class...
2
by: greyradio | last post by:
I've recently have been given an assignment to do and it seems that notify() does notify() any of the waiting threads. The project entails 10 commuters and two different toll booths. The EZPass booth...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.