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 2745
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...reducin g 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.
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 sure someone where will know
how to do the following.
We have a Word Template which is our standard contract type. I have some
data stored my access database record. I want to merge the two together.
|
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 that users are able to save
documents through our application using word 2000 as the editor. I have
written for word 2000 sothat the code works for other higher versions of
word.
|
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 = "P:\2004worksheets\IIS_WS.doc"
Set oWord = New Word.Application
oWord.Documents.Add (strObjectPath)
oWord.PrintOut
|
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 the moment the printed output is usually going to Word. It's turning into
an unholy mess, because I'm having to prepare umpteen different Word
templates, and the queries that drive them, depending on what events a
course has.
|
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
1. Query..I want to keep the fields seperatred. I do not want to sent
on field with all accumulated languages from one person to Word. Each
language should appear in the document in a separate cell
Cross tables are not delivering the result I...
| |
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
won't be broken when my app is opened with those versions.
Also is the Scripting Runtime included as part of the A2000 Runtime Engine
which some of my customers use.
|
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. Create a new C# ASP.NET web application named "demo" and modify
Session_Start in Global.asax.cs as follows:
protected void Session_Start(Object sender, EventArgs e)
{
Response.Write("Session_Start event fired at "+
|
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 graph/chart within the report, once again from VB.NET. I have
chosen to use Excel.Chart.8. So, to embed I do this from VB.NET:
Dim theNewShape As InlineShape = m_Document.InlineShapes.AddOLEObject
(ClassType:="Excel.Chart", _
|
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", , , strWhere) and strWhere is a variable containg a list of key's for the report to print from a table.
Is this possable to do?
The reason for this is the person printing the report would like to do some editing of a memo field before...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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 we have to send another system
|
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |