I have created a program in Word ( VBA) to print purchase orders, but the problem is when printing them since they print as one single spooled file per page, the Windows spooler sometimes prints them out of order. How could I go about resolving this. Any help or suggestions would be greatly appreciated. Thanks .
11 2735
I have created a program in Word ( VBA) to print purchase orders, but the problem is when printing them since they print as one single spooled file per page, the Windows spooler sometimes prints them out of order. How could I go about resolving this. Any help or suggestions would be greatly appreciated. Thanks .
Well im not sure if this is the best advice....but i personally would of tried a timer...between pages...reducing the posibility of them being printed in wrong order.....since it wont print something that it hasn't yet recieved
Try pausing between each print. -
Sub Test
-
' Code to print page 1
-
Call Pause(1)
-
-
' Code to print page 2
-
Call Pause(1)
-
-
' ...
-
End Sub
-
-
Private Sub Pause(seconds As Double)
-
Dim start As Long
-
-
start = Timer
-
-
Do Until Timer - start >= seconds
-
DoEvents
-
Loop
-
End Sub
Is pause a function of vba
Is pause a function of vba
Don't know....have you tried it?
No, Pause is a function that Winnie wrote, in the same message where it was used.
Note, you could also change the Windows print spooling settings. For instance, you can set it to begin printing immediately, rather than when the job is complete.
Note, you could also change the Windows print spooling settings. For instance, you can set it to begin printing immediately, rather than when the job is complete.
How will this help the situation ?
How will this help the situation ?
It will might make the printer read the pages in the right order....
The print routine is something like this: -
-
Private Sub PrintPO(d As Document)
-
Dim vBinNumbers As Variant
-
Dim vBinNames As Variant
-
Dim i As Integer
-
-
Application.ActivePrinter = "po"
-
d.Repaginate
-
-
'vBinNumbers = GetBinNumbers
-
'vBinNames = GetBinNames
-
-
'MsgBox vBinNames(4)
-
'MsgBox vBinNumbers(4)
-
For i = 1 To d.BuiltInDocumentProperties(wdPropertyPages)
-
d.Content.Find.Execute FindText:="PURCHASE ORDER COPY 2 - DEPARTMENT KEEP", ReplaceWith:="PURCHASE ORDER COPY 1 - CLAIM FORM", Replace:=wdReplaceAll
-
d.PageSetup.FirstPageTray = 259 'Correct (Tray 2)
-
d.PageSetup.OtherPagesTray = 259 'Correct (Tray 2)
-
d.PrintOut Range:=wdPrintFromTo, From:=Str(i), To:=Str(i)
-
d.Content.Find.Execute FindText:="PURCHASE ORDER COPY 1 - CLAIM FORM", ReplaceWith:="PURCHASE ORDER COPY 2 - DEPARTMENT KEEP", Replace:=wdReplaceAll
-
d.PageSetup.FirstPageTray = 258 'Correct (Tray 3)
-
d.PageSetup.OtherPagesTray = 258 'Correct (Tray 3)
-
d.PrintOut Range:=wdPrintFromTo, From:=Str(i), To:=Str(i)
-
Next
-
-
End Sub
-
-
The problem is , occasionally the purchase orders print out of order. Am I missing something or doing something wrong somewhere.
Anyone, how do you think I can correct this.
Does anyone have any ideas?
Well as far as I can see, you must be sending them in the wrong sequence. Because I don't see any way the spooler could jumble up the order of items within a single print file. If it got the file mixed up, you'd get garbage printed.
Perhaps you need to sort your records before printing them.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: JP SIngh |
last post by:
HI All
I just wonder if anyone has created a word document using ASP.
I am able to create a work document with ASP without any problem but what I
want to do is slightly more than I know. I am...
|
by: Raju Joseph |
last post by:
Hi All,
I have a small problem at hand and am looking for suggestions.
I have created a wrapper for word 2000 for our application which is in
VB.NET 2003. Everything works fine in the sense...
|
by: Stefania Scott |
last post by:
I am trying to print a word document from Access. The code I've
written works well in my computer but does not in the one were it is
needed.
Here the piece of code:
'doc path
strObjectPath =...
|
by: Mike MacSween |
last post by:
tblCourses one to many to tblEvents.
A course may have an intro workshop (a type of event), a mid course
workshop, a final exam. Or any combination. Or something different in the
future.
At...
|
by: svdh |
last post by:
I have posed a question last saturday and have advanced alot in the
meantime. But I am still not there
Problem is that I try to merging various fields from various tables in
one document in Word...
| |
by: Karl Irvin |
last post by:
To use the Textstream object, I had to set a Reference to the Microsoft
Scripting Runtime.
This works good with A2000
Is the Scripting Runtime included with A2002 and A2003 so the Reference...
|
by: Niklas Uhlin |
last post by:
Someone please explain why Session_Start fires multiple times /
retains SessionID values between sessions, when you open an ASP.NET
page from MS Word. For details of the problem, see below:
1....
|
by: Robin Tucker |
last post by:
Heres and interesting problem:
I have a VB.NET program that creates reports via. Word Automation. This all
works fine. What I want to do as part of this report generation process is
to embed a...
|
by: ljungers |
last post by:
Wondering if somone knows how to open a Access report in Word or export it to Word. Currently I'm opening and printing a report using VBA with the following command (DoCmd.OpenReport "TheReportName",...
|
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,...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |